Run Code
|
API
|
Code Wall
|
Users
|
Misc
|
Feedback
|
Login
|
Theme
|
Privacy
|
Patreon
How to find 2nd highest salary
create table sal ( id int, sal float ) insert into sal values(1,100),(2,500),(3,400),(4,200),(5,400),(6,350),(7,350) select * from sal order by sal desc ; with cte as ( select * , dense_rank() over (order by sal desc)dn from sal ) select id, sal from cte where dn = 2 select * , dense_rank() over (order by sal desc)dn from sal
run
|
edit
|
history
|
help
0
Please
log in
to post a comment.
student
Libros
String between two indexes
Генерация чисел в диапазоне в MS SQL
Basic Template
Co-Related sub query
db_hotelc
ASSESSMENT2
Left join producing wrong result
FIGURA5.1
Please log in to post a comment.