Q
Problem solve Get help with specific problems with your technologies, process and projects.

SQL to select rows 1000 through 3000 in a table

An Oracle user asks if they can use SQL to select rows 1000 through 3000 in a table.

I want to select, say, the 1000th row through 3000th row in a table. How can I do this? I don't have a sequence row in the table.

You probably meant to say that you don't have a sequence column in the table.

I am sorry to tell you that the answer to your question is "You can't." This is because rows in a database table have no sequence. The only time that you can see a sequence is when you use an ORDER BY clause in your SELECT statement. You need to specify at least one column for the ORDER BY. Even then, picking rows 1000 through 3000 is tricky, as the SQL depends entirely on which database system you're using.

Without an ORDER BY clause, the whole concept of "rows 1000 through 3000" has no meaning.

This was last published in July 2008

Dig Deeper on Oracle development languages

PRO+

Content

Find more PRO+ content and other member only offers, here.

Have a question for an expert?

Please add a title for your question

Get answers from a TechTarget expert on whatever's puzzling you.

You will be able to add details on the next page.

Start the conversation

Send me notifications when other members comment.

By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy

Please create a username to comment.

-ADS BY GOOGLE

SearchDataManagement

SearchBusinessAnalytics

SearchSAP

SearchSQLServer

TheServerSide

SearchDataCenter

SearchContentManagement

SearchFinancialApplications

Close