from the table display the 2nd highest salary?
and also the least 2nd salay?
Answer Posted / sridhar sahoo
select distinct top 1 salary from payroll..emp where salary
in(select distinct top N salary from payroll..emp order by
salary desc)
if u want top 2 put 2 at the pacece of N
if u want top 5 put 5 at the pacece of N
if u want ..............................
| Is This Answer Correct ? | 0 Yes | 0 No |
Post New Answer View All Answers
What are orphan records?
Why we need to use secondry database file? though, we can do same work using primary database file also.
How many servers can we create in a single subscription?
What is lock escalation and what is its purpose?
How do I know if localdb is running?
What are the steps you must follow to hide sql server instances?
Explain system scalar functions?
Can we shrink data file in sql server?
What is Sqlpaging in SqlServer 2005 ?
Please differentiate between a local and a global temporary table?
How display code or Text of Stored Procedure using Sql query in Sql Server ?
What is tablesample?
What are various aggregate functions that are available?
you have developed an application which uses many stored procedures and triggers to update various tables users ocassionally get locking problems which tool is best suited to help you diagnose the problem? : Sql server administration
How to assign null values to variables or columns?