SKNaidu
05-02-2003, 07:57 AM
hi
i want to retrieve the values of rows between 5th and 10th rows out of 500 rows in a table.
thanks
SKNaidu
i want to retrieve the values of rows between 5th and 10th rows out of 500 rows in a table.
thanks
SKNaidu
|
Click to See Complete Forum and Search --> : how toget values between 5th and 10th rows SKNaidu 05-02-2003, 07:57 AM hi i want to retrieve the values of rows between 5th and 10th rows out of 500 rows in a table. thanks SKNaidu hrishy 05-02-2003, 08:02 AM 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 nik_flash 05-02-2003, 09:17 AM try using rownum for e.g- select customerid from customer where rownum <11 MINUS select customerid from customer where rownum<6; 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 chrisrlong 05-02-2003, 01:03 PM 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: 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 - Chris dbasupport.com
Copyright Internet.com Inc. All Rights Reserved. |