Oracle SQL Pagination

Select records from Mth row to Nth row:

SELECT
id
,uen
,entity_legal_name
,trade_system
,trade_date
,mapping_booking_location
,booking_region
,product_type
,trade_type
,expected_count_of_trades
,actual_count_of_trades
,value
,currency
,in_previous_weeks_report
FROM
(
SELECT
rownum row_number
,a.*
FROM
dnb_dly_sys_profile a
WHERE
trade_date>=’2014-09-08′
AND trade_date<‘2014-09-15’
AND entity_legal_name LIKE ‘RAYMOND JAMES%’
AND product_type=’OUTRIGHT TRADE’
AND rownum <= N
)a
WHERE
row_number>=M

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s