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 a null value?

659


Does sql profiler affect performance?

561


how many columns can be used for creating index? : Sql dba

524


How to select all records from the table?

611


How is sql used in oracle?

583






How does one use sql*loader to load images, sound clips and documents? : aql loader

674


How can we avoid duplicating records in a query?

568


Show the cursor attributes of pl/sql.

615


What is varchar data type in sql?

520


What is the most common sql injection tool?

547


write an sql query to find names of employee start with 'a'? : Sql dba

583


What is the use of count (*) in sql?

551


How do you create a unique index?

575


When can we use the where clause and the having clause?

582


what is the use of set statement in tsql? : Transact sql

537