how u can find the n row from a table?

Answer Posted / rishab

select emp_name,salary,rownum from
(select emp_name,salary,r from
(select salary,emp_name,rownum r from
(select salary,emp_name,rownum
from emp
order by salary desc)
order by r)
where r<4 ---- this number must be n+1
order by salary)
where rownum=1;
-- yes rownum=1 works...

Is This Answer Correct ?    4 Yes 3 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is sql scripting?

539


what is the difference between delete and truncate statement in sql? : Sql dba

525


What are local and global variables and their differences?

564


What is the location of pre_defined_functions.

619


Where the sql database files are stored?

457






Explain select statements in sql?

563


What are the advantages of indexing?

489


What is normalization in sql?

506


How many sql statements are used?

544


How many clustered indexes can you have?

508


What is orm in sql?

514


Explain the purpose of %type and %rowtype data types with the example?

531


how can we take a backup of a mysql table and how can we restore it. ? : Sql dba

489


What is the purpose of a secondary key?

488


How many sql statements are used? Define them.

554