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
What is an active database?
What are the restraints imposed on the table design by a merge replication?
How you can add messages to the nt event log from within a stored procedure?
What is the difference between ddl and dml?
What is the difference between a fill factor of 100 and 0?
What are the triggers in sql?
What is plan freezing?
how would you improve etl (extract, transform, load) throughput?
What is save transaction and save point?
What security features are available for stored procedure?
Explain the first normal form(1nf)?
What is a trigger and types of a trigger?
How do I view views in sql server?
Can a database be shrunk to 0 bytes, if not, why?
How to recompile stored procedure at run time?