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
can an automatic recovery be initiated by a user? : Sql server administration
Which tcl commands are available on the sql server?
Does partitioning ssd reduce performance?
Explain few examples of RDBMS?
What is tempdb database? : SQL Server Architecture
Explain the difference between control flow and data flow?
Can group functions be mixed with non-group selection fields in ms sql server?
Can the query output be sorted by multiple columns in ms sql server?
When would you use the stored procedures or functions?
How to provide default values to stored procedure parameters?
What is the default Port No on which SQL Server listens?
Is truncate a dml command?
Explain the advantages of merge replication?
Why and when do stored procedure recompile?
Write an sql query to find first weekday of the month?