can anybody tell us, how to select 2nd max salary from
table.
my id is ashish.akk@gmail.com
Answer Posted / syaam
select a.sal from emp a
where 2=(select count(distinct b.sal) from emp b
where a.sal<= b.sal)
for getting nth max sal ..replace 2 by n
all the best
| Is This Answer Correct ? | 0 Yes | 1 No |
Post New Answer View All Answers
Differentiate between sql temp table vs table variable?
What is the difference between system objects and user objects?
Where can you add custom error messages to sql server?
What is the default order of an order by clause?
What are the 10 characteristics of data quality?
What is BCP? When does it used in sql server 2012?
What is read committed?
How to execute stored procedure in select statement sql server?
Does index slows down insert statements?
What are .mdf files?
What is the meaning of resultset type_scroll_insensitive?
what is blocking? : Sql server database administration
Differentiate between a primary key and a unique key.
Write a sql query to display the current date?
Can you please differentiate between a primary key and a unique key?