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
What is coalesce and check constraint in sql server?
What Are the Main Features of SQL Azure?
How to create “dependant” parameter “make, model, year”
What is self contained multi valued query?
Explain different types of collation sensitivity?
How much is a sql server license?
how to determine the service pack currently installed on sql server? : Sql server database administration
What is the recovery model?
How to define the name and server for a new dsn?
Explain the creation and execution of a user-defined function in the sql server?
What is user defined stored procedures?
How to check if a table is being used in sql server?
How to select all columns of all rows from a table with a select statement in ms sql server?
Explain different backup plans?
What is the default server name for sql server?