I Have Employee table having column name as ID,SALARY
how to get second max salary from employee table with id
ex
ID SALARY
1 20000
7 37000
2 5000
Answer Posted / bhagya
select * from emp as e1 where 1= (select count(*)from emp
as e2 where e1.sal<e2.sal)
Is This Answer Correct ? | 9 Yes | 11 No |
Post New Answer View All Answers
What is the difference between TRUNCATE and DROP?
Delete duplicate rows without using rowid.
What are the system database in sql server 2005?
Explain powershell included in sql server 2008?
Does any body please help me what question's have asked for SSRS in the interview?
Write a sql query to sort on different column name according to the parameters passed in the function?
How many replicas are maintained for each sql azure db?
What are the acid properties?
What do you understand by coalesce in sql server?
Detail about the hardware which is supported by SQL server?
Explain atomicity?
How to transfer data from a cursor to variables with a "fetch" statement?
How many levels of sp nesting are possible?
in the physical file layout, where should the transaction log be stored in relation to the data file?
What is pessimistic concurrency?