how to find nth highest salary
Answer Posted / bharath
select distinct(sal) from emp a where 3 = (select
count(distinct(sal)) from emp b where a.sal<= b.sal)
replace 3 by 2 for second highest...
Is This Answer Correct ? | 4 Yes | 0 No |
Post New Answer View All Answers
What is a with(nolock)?
What are data driven subscriptions?
What are the pros and cons of putting a scalar function in a queries select list or in the where clause?
How to recover from sql injection? : sql server security
What is lock escalation? : sql server database administration
How many clustered indexes can be created on a table? I create a separate index on each column of a table. what are the advantages and disadvantages of this approach?
what protocol both networks use? : Sql server database administration
How can sql server instances be hidden?
How do I change my passwords (database, LDAP, and so on) without causing an outage?
What is BCP? When does it used in sql server 2012?
What does nvl stand for?
What are trace files?
Explain few examples of RDBMS?
What is the sql case statement used for?
how we use window authentication connection with sql server.?