from the table display the 2nd highest salary?
and also the least 2nd salay?
Answer Posted / bobby
select p.emp_id,p.name,p.salary from
(select emp_id,name,salary,dense_rank()over( order by
salary desc)maxrank,
dense_rank()over( order by salary asc)minrank from test)p
where maxrank=2 or minrank=2
| Is This Answer Correct ? | 2 Yes | 0 No |
Post New Answer View All Answers
What is ms sql server reporting services?
Explain the difference between primary keys and foreign keys?
Can we take the full database backup in log shipping?
Explain different forms of normalization?
Where does the copy job runs in the log shipping primary or secondary? : sql server database administration
Is there any performance difference between if exists (select null from table) and if exists (select 1 from table)?
How can windows applications connect to sql servers via odbc?
How to include text values in sql statements?
How to create a local temporary stored procedure?
Is resultset an interface?
What is the difference between ddl,dml and dcl commands?
Does union all remove duplicates?
What is a partition key?
How can you control the amount of free space in your index pages?
in a table is b in column k (manikanta,sivananda,muralidhar) i want result like (mnikanta,sivnanda,murlidhar) please slove it