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 6334757
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T18:43:17+00:00 2026-05-24T18:43:17+00:00

Is it possible to skip X first rows, and select all the other rows

  • 0

Is it possible to skip X first rows, and select all the other rows in one query?
Like that:

abc
def
ghi
jkl
mno
========= start selecting all from here =========
pqr
stu
vwx
yz

And it will select: pqr, stu, vwx, yz

I’ve tried to accomplish that with LIMIT and OFFSET, but the problem is that the table is dynamic, and I don’t know which LIMIT should I put (I don’t know how many rows in the 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-05-24T18:43:18+00:00Added an answer on May 24, 2026 at 6:43 pm

    If you just want the last N rows, try this:

    SELECT field1, field2 FROM table
    ORDER BY some_column DESC
    LIMIT N;
    

    This gives you the last few records based on the order of some_column.

    You can use an auto-incrementing primary key (hopefully there is one) to establish the order of the rows if nothing else can be used.

    If instead you want to skip the first X rows (which you indicate in the question) and get all rows until the end, try this:

    SELECT field1, field2 FROM table
    ORDER BY some_column ASC
    LIMIT 18446744073709551615 OFFSET X;
    

    For this latter case, see: MySQL Offset Infinite Rows

    Though, if you do have an auto-incrementing primary key, and it corresponds with the rows you want to select, I recommend:

    SELECT field1, field2 FROM table
    WHERE id > X;
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

my requirement is to read all rows of an excel-sheet in first column that
Possible Duplicate: How to skip first child? I have a ul with 4 li
my question is simple. Is it possible skip the auth dialog that requesting for
Possible Duplicate: Is it possible to skip parameters that have default values in a
Is it possible by using sscanf to get the first token then skip some
In sed , is it possible to skip the first n lines when applying
Is it possible to skip a couple of characters in a capture group in
In C++ it is possible to skip method parameter identifier if it's unused: void
Is it possible, in Java, to make a JPanel skip drawing its background thus
Possible Duplicate: NAnt or MSBuild, which one to choose and when? What is the

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.