Reputation: 1505
I am quite new to Postgres database. I have one query:
select offer_id, offer_date
from CMS_OFFER
where ROWNUM < 300
which executes in Oracle but in Postgres it is not excuted. I tried with row_number() also. It is not able to execute. Please help me: how I can achieve this?
Upvotes: 1
Views: 28936
Reputation: 262774
While not exactly the same as Oracle's ROWNUM, Postgresql has LIMIT:
select offer_id,offer_date from CMS_OFFER LIMIT 299
The difference is that ROWNUM is applied before sorting, and LIMIT after sorting (which is usually what you want anyway).
Upvotes: 7