adspace


can anybody tell us, how to select 2nd max salary from
table.
my id is ashish.akk@gmail.com

Answer Posted / prasad237

with x as(select row_number over(order by sal desc) as rid,* from emp)
select * from x where rid=n
we can retrieve nth max sal

Is This Answer Correct ?    0 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

How to enter binary string literals in ms sql server?

1246


what is spatial nonclustered index

1060


How efficient you are in oracle and SQL server?

1258


How to rebuild the master database?

1167


Can we make the the chages By Using the Sql if u know any function or process please inform me Actuall result: BRK1 Break 1 Part 1 00:01:00:00 60 BRK1 Break 1 Part 2 00:01:00:00 60 BRK2 Break 2 Part 1 00:01:00:00 60 BRK2 Break 2 Part 2 00:01:00:00 60 BRK2 Break 2 Part 3 00:01:00:00 60 BRK3 Break 3 Part 1 00:01:00:00 60 BRK3 Break 3 Part 2 00:01:00:00 60 Desired O/P: BRK1 Break 1 Part 1 00:01:00:00 60 Part 2 00:01:00:00 60 BRK2 Break 2 Part 1 00:01:00:00 60 Part 2 00:01:00:00 60 Part 3 00:01:00:00 60

2296


Can we do dml on views?

1039


Why use identity in sql server?

1203


How can we solve concurrency problems?

1123


How do I find query history in sql server?

1026


What are the different subsets of sql?

1655


What are the pros and cons of putting a scalar function in a queries select list or in the where clause?

1300


What is the difference between for xml raw and for xml auto?

1119


What are the different types of subquery?

1235


Can one drop a column from a table?

1091


How to remove duplicate rows from table except one?

1091