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 bind variable in pl sql?

540


Inline the values in PL/SQL, what does it mean.?

643


Can we call stored procedure in function?

562


Why having clause is used in sql?

555


How do you clear the screen in sql?

611






What do you understand by case manipulation functions?

556


How to change a value of the field ‘salary’ as 7500 for an employee_name ‘john’ in a table employee_details?

918


Which operator is used in query for pattern matching?

640


What is a database trigger?

622


What is a record in a database?

567


What is the limitation on the block size of pl/sql?

536


What is view? Can we update view

872


What is a crud api?

506


Explain clause in sql?

568


How to move files from one directory to another in pl sql?

648