How to get the 5th highest value from a table?
Table:tblEmp
Fields Emp_Name,Emp_Salary
Emp_Name Emp_Salary
A 25000
B 35000
C 12000
D 50000
E 14000
F 18000
G 28000
H 50500
I 40000
From this table I want to konw who is getting 5th highest salary?
SELECT ROWNUM NUM_K, K.* FROM (SELECT ROWNUM NUM_M, M.*
FROM ( select A.EMPLID,A.EFFDT
from ( select * from ps_job where emplid = 'FHQ4' ORDER BY EFFDT DESC ) A
WHERE ROWNUM <= Variable ) M
ORDER BY EFFDT ASC ) K
WHERE ROWNUM <=1
Note :Where varaiable is the nth largest u want
Subscribe to:
Post Comments (Atom)
Troubleshooting ACFS-07981: Metadata Validation Errors
Troubleshooting ACFS-07981: Metadata Validation Errors Introduction The ACFS-07981 error indicates that an attempt to run an online file ...
-
ORA-00221 Error on write to controlfile Possible Causes and Solutions An error has occurred when trying to create the control file, or on su...
-
Mastering ORA-00054: Resolving the "Resource Busy" Error The ORA-00054 error, often accompanied by the message "resource b...
-
How to change password in Oracle Transportation Management(OTM) If you want to change other usernames/passwords, then the list expands be...
No comments:
Post a Comment