Jun 22, 2002 #1 kathalena Technical User Joined Jun 22, 2002 Messages 3 Location AT which function lets me select the first n rows of a table (oracle, sqlplus)? and which one selects the 2nd row (for example)? i didn't find any function for that query... thanks, kathalena
which function lets me select the first n rows of a table (oracle, sqlplus)? and which one selects the 2nd row (for example)? i didn't find any function for that query... thanks, kathalena
Jun 22, 2002 #2 vikramkalsi Programmer Joined Aug 25, 2001 Messages 35 Location US e.g. To select first 4 rows from STUDENTS table. SQL> select id from students where rownum < 5; ID ---------- 10000 10001 10002 10003 To select 2nd row from the same query SQL>(select id from stds where rownum < 3 ) minus (select id from stds where rownum < 2 ); ID ---------- 10001 Hope this helps. -Vikram Upvote 0 Downvote
e.g. To select first 4 rows from STUDENTS table. SQL> select id from students where rownum < 5; ID ---------- 10000 10001 10002 10003 To select 2nd row from the same query SQL>(select id from stds where rownum < 3 ) minus (select id from stds where rownum < 2 ); ID ---------- 10001 Hope this helps. -Vikram
Jun 22, 2002 Thread starter #3 kathalena Technical User Joined Jun 22, 2002 Messages 3 Location AT THANKS a lot!! it works! kathalena Upvote 0 Downvote
Jun 22, 2002 Thread starter #4 kathalena Technical User Joined Jun 22, 2002 Messages 3 Location AT thanks a lot, it works! kathalena Upvote 0 Downvote