how can we find nth max salary from A table
Answers were Sorted based on User's Feedback
Answer / asp
select * from table1 a where (n-1) = (select count(distinct
(sal)) from table1 b where b.sal>a.sal)
| Is This Answer Correct ? | 15 Yes | 5 No |
Answer / bhaskar reddy
select * from table1 a where(n-1)= (select count(distinct
sal) from table1 b where b.sal>a.sal)
| Is This Answer Correct ? | 6 Yes | 5 No |
Answer / sivaraman
select * from table1 a where n = (select count(distinct
(sal)) from table1 b where b.sal>a.sal)
n is value of n it should be numeric....
| Is This Answer Correct ? | 15 Yes | 15 No |
Answer / a
select MAX(Salary) from Employee
WHERE Salary NOT IN (select MAX(Salary) from Employee )
| Is This Answer Correct ? | 0 Yes | 9 No |
How to insert more than one record using insert?
what is the sqlcode -501
What is reorg in database?
When do you use the IMAGECOPY?
How to check table size in db2 sap?
select * from orders where odate between '2010-01-01'and '2010-03-31' How do u fetch this into cursor?
When is the skeleton cursor table created?
My DB2 program first read the data from a file and then it look into a table with the data it got from the file.If we did not bind the program , should the file read before SQL execution be success??
What is the connection string to connect to the DB2 Database ?
select distinct(empid),distinct(dept),name from EMP will the above query work?
How to resolve -803 sql code in DB2?
Mention some fields that are a part of sqlca.