how to retrive only second row from table?

Answer Posted / zeljko

This answer_10 will work only if there is not order by used
on select statement.
I recommend using dense_rank function to get second row out
as in example;

SELECT * FROM (
SELECT id, first_name, salary,
DENSE_RANK() OVER(ORDER BY salary desc) row_order
FROM employee)
WHERE row_order = 2;

Is This Answer Correct ?    11 Yes 2 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

can sql servers linked to other servers like oracle? : Sql dba

749


What is transaction control language (tcl)?

848


Why is nosql good?

775


Explain character-manipulation functions?

835


When you have to use a default "rollback to" savepoint of plvlog?

910






How do I save a sql query?

729


What is sql server and ase?

711


What is compilation error in pl sql?

695


how to do backup entire database? : Transact sql

880


Can we create clustered index without primary key?

710


What is difference between sql and oracle?

773


How do you explain an index number?

744


What is latest version of sql?

710


Can you selectively load only those records that you need? : aql loader

771


Is oracle and sql same?

743