Skip to Main Content

Java Database Connectivity (JDBC)

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Working with rownum (Oracle)

843854Jan 4 2002 — edited Jan 7 2002
When using JSP to retrieve results,

SELECT * FROM (SELECT pub, class, startdate, adtext FROM classifieds WHERE (pub='KWR') AND (startdate<='04-Jan-02') ORDER BY pub) WHERE rownum<=25

Will return the first 25 rows even if there are more. I am told that I CAN specify a range but when I do this:

SELECT * FROM (SELECT pub, class, startdate, adtext FROM classifieds WHERE (pub='KWR') AND (startdate<='04-Jan-02') ORDER BY pub) WHERE rownum=>1 AND rownum<=50

I get the following error:

Exception=java.sql.SQLException: ORA-00936: missing expression Just wondering if anyone notices what I am missing...
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Feb 4 2002
Added on Jan 4 2002
10 comments
170 views