rajasivam


{ City } chennai
< Country > india
* Profession * dwh technician
User No # 18768
Total Questions Posted # 0
Total Answers Posted # 1

Total Answers Posted for My Questions # 0
Total Views for My Questions # 0

Users Marked my Answers as Correct # 0
Users Marked my Answers as Wrong # 4
Questions / { rajasivam }
Questions Answers Category Views Company eMail




Answers / { rajasivam }

Question { HCL, 10632 }

write a query to display to 10 max record from the employee
table?


Answer

To find nth value

select salary from emp a where &n=(select count(distinct
salary) from emp b where a.empno<=b.empno);

to find max by nth value a.empno<=b.empno
to find min by nth value a.empno>=b.empno

OR

To find 10 max records

select * from (select * from emp order by salary desc) where
rownum<=&n;

Is This Answer Correct ?    0 Yes 4 No