Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8897601
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T00:23:16+00:00 2026-06-15T00:23:16+00:00

How do I return a certain number of rows, that are a certain number

  • 0

How do I return a certain number of rows, that are a certain number of rows from the top of a SELECT query?

What I mean is, suppose I had a table with 1000 rows. Suppose I want the first 50 rows, then I want the second 50 rows, then the third 50 rows, and so on. I know that TOP or LIMIT will limit the number of rows that are returned, but I am unsure how to tell SQL to get me the rows from a certain point in the returned table.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-15T00:23:18+00:00Added an answer on June 15, 2026 at 12:23 am

    In Sql server you can make use of ROW_NUMBER() function to do thing you want

    SELECT ROW_NUMBER() OVER(ORDER BY col3 DESC) AS Row, 
        col1, col2, col3
    FROM tablename
    

    in short

    WITH ctetable AS
    (
        SELECT ROW_NUMBER() OVER(ORDER BY col3 DESC) AS RowNumber , 
            col1, col2, col3
        FROM tablename 
    ) 
    SELECT * 
    FROM ctetable 
    WHERE RowNumber BETWEEN 1 AND 50;
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I only want to return a certain number of rows into the DataTable via
I am trying to write a linq query that will only return certain columns
I need to know the number of rows in a certain table. If it
I'm not certain how to structure a SQL query to return the number of
How would I query for values near a certain number. I.E. suppose the database
I have created a tool using jQuery that will show certain table rows depending
I have used a ResultSet that returns certain number of rows. My code is
Is it possible to select individual rows within a table from a list of
Hi I am trying to return only a certain element from xml.. it is
I have a function that I would like to return 0 if a certain

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.