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 top1 id,salary from employee
where
(salary<(select max (salary) As sal from employee As Empp))
orderby salary desc.
| Is This Answer Correct ? | 5 Yes | 0 No |
Post New Answer View All Answers
Can we add an identity column to decimal datatype?
How is foreign key related to primary key?
How can we get count of the number of records in a table?
tell me what is blocking and how would you troubleshoot it? : Sql server database administration
Can we use pragma autonomous_transaction in trigger?
what is hash nonclustered index
What is code near application topology?
What program is used to store the data source file?
What are the difference between clustered and a non-clustered index?
What is server-level principal?
Is sql server 2016 free?
How to specify the collation for a character data type in ms sql server?
What stored procedure can you use to display the current processes?
How do I edit a stored procedure in sql server?
How will you optimize a stored procedure optimization?