View previous topic :: View next topic
|
Author |
Message |
bsng_surru
New User
Joined: 07 Mar 2005 Posts: 16
|
|
|
|
suppose there are 100 rows in a table how one can retrieve rows from 20 to 30? |
|
Back to top |
|
|
gorle_n4
New User
Joined: 11 Mar 2005 Posts: 8 Location: hyderabad
|
|
|
|
hi!
u can do it by using rowid. iam not sure. plz try it.
all the best. |
|
Back to top |
|
|
sangar_blr
New User
Joined: 01 Apr 2005 Posts: 8
|
|
|
|
Hi ,
u can find the row id of the first row then u use in between cluase in ur quary. It may be work!!! im not sure.. |
|
Back to top |
|
|
sangar_blr
New User
Joined: 01 Apr 2005 Posts: 8
|
|
|
|
Hi ,
u will find the row id of the first row then u use in between cluase in ur quary. It may be work!!! im not sure.. |
|
Back to top |
|
|
Girishm
New User
Joined: 09 Mar 2005 Posts: 35 Location: Mysore
|
|
|
|
Hi Surendranath Gupta,
The below query will fulfill your need to select rows randomly.
WITH TEMPTABLE AS
(SELECT COL_NAME1, COL_NAME2, ROW_NUMBER() OVER (ORDER BY COL_NAME1)
AS RN FROM YOUR_TABLE_NAME )
SELECT COL_NAME1, COL_NAME2, RN
FROM TEMPTABLE WHERE RN BETWEEN 20 AND 30 ORDER BY RN
PS: In the order by clause (col_name1) better you use PRMARY KEY.
___________
GM |
|
Back to top |
|
|
bsng_surru
New User
Joined: 07 Mar 2005 Posts: 16
|
|
|
|
grishm thanks |
|
Back to top |
|
|
|