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

How many postgresql users are there, worldwide?

581


What are all different types of collation sensitivity?

529


How many columns should be in an index?

524


Is left join same as inner join?

542


What is query optimization in sql?

550






Why we use sql profiler?

563


What is indexing in sql and its types?

547


What are analytic functions in sql?

553


Does sql require a server?

532


what are the 'mysql' command line options? : Sql dba

560


What is the difference between subquery and correlated query?

532


What is execution plan in sql?

551


How exception is different from error?

545


What is a crud api?

502


What is difference between hql and native sql?

585