advanced code snippet search
jaytee on 09/17/08
09/17/08 03:38pm
DECLARE number1 NUMBER(2); number2 NUMBER(2) := 17; text1 VARCHAR2(12) := 'Hello world'; text2 DATE := SYSDATE; -- current date and timeBEGIN SELECT street_number INTO number1 FROM address WHERE name = 'Smith';END;
Report this snippet Tweet
To get n th row in a table :
select * from tt a where &n = (select count(rowid) from tt where rowid
To get last row in a table :
select * from tt where rowid = (select max(rowid) from tt);
http://www.inventorstechnologies.com
To get second max sal in a table :
select max(sal) from tt where sal
Comment:
You need to login to post a comment.
To get n th row in a table :
select * from tt a where &n = (select count(rowid) from tt where rowid
To get last row in a table :
select * from tt where rowid = (select max(rowid) from tt);
http://www.inventorstechnologies.com
To get second max sal in a table :
select max(sal) from tt where sal