hi
i want to retrieve the values of rows between 5th and 10th rows out of 500 rows in a table.
thanks
SKNaidu
Printable View
hi
i want to retrieve the values of rows between 5th and 10th rows out of 500 rows in a table.
thanks
SKNaidu
Hi
You should have a date column in the table..then you can select between 5th and the 10th row..otherwise its not possible in relational database..
By the whats the criteria of 5th and 10th row in a 500 row table ?
regards
Hrishy
try using rownum
for e.g-
select customerid from customer where rownum <11
MINUS
select customerid from customer where rownum<6;
Quote:
Originally posted by SKNaidu
hi
i want to retrieve the values of rows between 5th and 10th rows out of 500 rows in a table.
thanks
SKNaidu
Oh no no no no.
Do not use MINUS for this proble - ROWNUM is the proper solution.
You can add paging to any query by wrapping it in paging logic:
- ChrisCode:
SELECT
*
FROM
(
SELECT
INNER.*,
ROWNUM
AS QUERY_ROWNUM
FROM
(
SELECT
O.ORG_PK ,
OH.DSPLY_NM
FROM
ORG O ,
ORG_HDR OH
WHERE
O.ORG_DBA_NM LIKE :ORG_NM || '%' AND
OH.ORG_PK = O.ORG_PK
ORDER BY
O.ORG_PK
) INNER
WHERE
ROWNUM <= :EndRow
) OUTER
WHERE
OUTER.QUERY_ROWNUM >= :StartRow