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 the server name in sql server?
What are indexes in ms sql server?
How you can add messages to the nt event log from within a stored procedure?
Explain primary key and foreign key constraints?
Is foreign key unique?
What is a sql join?
What are examples of triggers?
What is difference between oltp and olap?
I applied Transactional with updatable subscriptions replication on 2 tables now i want to delete those 2 tables but i cannot delete those tables as replication is running how can i stop replication for those 2 tables(but i don't want to delete those replicated tables but i need to stop the replication) how can i do that
What is dynamic cursor in SQL SERVER?
How to create a view on an existing table in ms sql server?
What is conditional split?
How to receive returning result from a query?
What will happen if a column containing char type data is changed to the nchar data type?
How to Insert multiple rows with a single insert statement?