This week's book giveaway is in the General Computing forum.
We're giving away four copies of Arduino in Action and have Martin Evans, Joshua Noble, and Jordan Hochenbaum on-line!
See this thread for details.
The moose likes JDBC and the fly likes fetch first in Oracle Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


JavaRanch » Java Forums » Databases » JDBC
Reply Bookmark "fetch first in Oracle" Watch "fetch first in Oracle" New topic
Author

fetch first in Oracle

shell Johnson
Ranch Hand

Joined: Jul 17, 2002
Posts: 37
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

Joined: Apr 25, 2003
Posts: 100
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.


An egg is a chicken's house!
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: fetch first in Oracle
 
Similar Threads
Export ResultSet to pipe delimited file
Java API for Exchange Server
jdbc resultset to xml
JdbcOdbcDriver/Stored procedures. Please help
Getting the "Most Recent" Record via SQL