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 / elumalai.k
select id,max(salary)from employee where salary<(select
max(salary)from employee)
| Is This Answer Correct ? | 15 Yes | 6 No |
Post New Answer View All Answers
What is nested transaction?
What is the meaning of resultset type_scroll_insensitive?
What is sql server 2000 work load governor?
What is difference between index seek vs. Index scan?
in the physical file layout, where should the transaction log be stored in relation to the data file?
How to check what was the last restore transaction LSN in Log shipping or Mirroring? when we don't have a Monitor or witness server.
Why is there a performance difference between two similar queries where one uses union and the other uses union all?
What stored by the model? : sql server database administration
What is a DBMS, query, SQL?
What are built in functions?
What are the differences between union, intersect, and minus operators?
What is inline variable assignment?
What is set nocount on?
What happens if you delete a table that is used by a view?
How to create view in stored procedure sql server?