Run Code
|
API
|
Code Wall
|
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
libros
updated
Insert index into Temporary Table
Sample of Update~Delete with OUTPUT clause (2016 >)
IOU
MERGE WITH OUTPUT
Names
Exam_1
Exa
Program 3 Lab Assignment