Need a SQL query to find 5th highest salary of employee without using rank or top functions | Sololearn: Learn to code for FREE!
Neuer Kurs! Jeder Programmierer sollte generative KI lernen!
Kostenlose Lektion ausprobieren
0

Need a SQL query to find 5th highest salary of employee without using rank or top functions

I have a table columns emp I'd,emp salay, Need a SQL to find 5th highest salary of employee without using rank or top functions

6th Aug 2021, 8:58 PM
vijay
vijay - avatar
1 Antwort
+ 2
There is a way you can generate rownum (1, 2, 3, ...) on the sorted result set. How you do it depends on which DB engine you are using. Then select from that augmented set (e.g., as a subquery) where rownum=5.
7th Aug 2021, 12:37 AM
Brian
Brian - avatar