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 |
Discuss about db2 bind?
how will you retrieve first record in table
When one binds a PACKAGE ( of a plan ) what package information is stored and where it is stored?
What is the maximum length of a column name in DB2? 18 or 30 or anything other than these?
Is it possible to alter a table – for example adding a column, when another user is accessing or updating some columns?
before altering a table is it necessary to lock ? if lock what is it ? how to do ? ifi want to lock a table what is that command ?
what is different three logs in DB2?
What is the physical storage length of the data types: date, time, timestamp in the db2 database?
How do I delete a column in db2?
Hi Dude,this is Ram.could any one tell me aboue CURRENT OF clause in DB2. Thanks in advance.......
Suppose I have a program which uses a dynamic SQL and it has been performing well till now. Off late, I find that the performance has deteriorated. What happened?
What information can you find in SYSIBM.SYSLINKS table?