How to SELECT specific ROWS from a TABLE
Thats a tricky thing to do.At first do select with an extra row as rownum.And do another select based on this select using where to specify specific rows.I think an example can elaborate this.
table A:
----------
name roll_no
----- -------
hasim 02MCA07
mamnoon 03MCA45
matin 02MCA50
anwar 02MCA09
gafur 03MCA56
SELECT name FROM (SELECT name,ROWNUM n FROM A) WHERE n BETWEEN 2 AND 4
This query will fetch:
mamnoon
matin
anwar
Labels: Technical_HowTo_PLSQLOracle
1 Comments:
Thanks.Its really good.
Post a Comment
<< Home