how to retrive only second row from table?

Answer Posted / tulasi ravi kumar

hi this tulasi .....+91-9951123501
in SQL Server 2000 we write as...
declare CurTemp scroll cursor for
select top 2 * from <table_name>
open CurTemp
fetch last from CurTemp
close CurTemp
deallocate CurTemp;

in ORACLE , we can write as..

select * fom <table_name>
where rowid=(select rowid from <table_name>where rownum<=2
minus
select rowid from <table_name>
where rownum<2;

so try it ...

Is This Answer Correct ?    17 Yes 5 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is compute?

533


How to avoid using cursors?

573


What is meant by truncate in sql?

500


what is 'mysqld'? : Sql dba

516


How is sql used in oracle?

559






how can you see all indexes defined for a table? : Sql dba

522


What plvcmt and plvrb does in pl/sql?

838


Can we perform dml on view?

530


Explain the purpose of %type and %rowtype data types?

483


What does (*) mean in sql?

512


What do we need to check in database testing?

534


Can you have more than one trigger on a table?

503


What is a primary key? Explain

518


What is the importance of sqlcode and sqlerrm?

819


Define commit?

528