• Post Reply Bookmark Topic Watch Topic
  • New Topic

fetch first in Oracle

 
shell Johnson
Ranch Hand
Posts: 37
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Any one know how to do the following sql in Oracle?
select c1 from table1 order by c2 fetch first 1000 rows only
 
Jason Steele
Ranch Hand
Posts: 100
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I believe you need to do:

SELECT .... WHERE ROWNUM > 0 AND ROWNUM < 1000 ORDER BY c2

It's been a while since I used Oracle, but I believe that's it.
 
Happiness is not a goal ... it's a by-product of a life well lived - Eleanor Roosevelt. Tiny ad:
the new thread boost feature: great for the advertiser and smooth for the coderanch user
https://coderanch.com/t/674455/Thread-Boost-feature
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!