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 sql engine in oracle?

721


Explain the components of sql?

789


What is a call statement? Explain with an example.

744


What is input buffer in sql*plus?

825


what is offset-fetch filter in tsql? : Transact sql

714






How do you declare a user-defined exception?

718


What are commit, rollback, and savepoint?

738


give the syntax of grant and revoke commands? : Sql dba

800


How to get unique records from a table?

682


Explain ddl statements in pl/sql?

734


Are stored procedures faster than queries?

695


how to add a new column to an existing table in mysql? : Sql dba

775


what happens when the column is set to auto increment and you reach the maximum value for that table? : Sql dba

765


How to raise user-defined exception with custom sqlerrm ?

862


What is pl sql script?

730