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


Please Help Members By Posting Answers For Below Questions

How to create nested stored procedure?

537


What are different types of raid levels?

547


What happens if you add a new index to large table?

507


What are the reporting services components?

92


What are the five characteristics of good data?

511






What is subquery? Explain the properties of a subquery?

503


Explain different types of Normalization.

593


You want to use bids to deploy a report to a different server than the one you chose in the report wizard. How can you change the server url?

110


can a database be shrunk with users active? : Sql server administration

559


What is a result set object returned by odbc_exec()?

544


Tell me what is a linked server?

558


Explain the rules for designing files and file groups in sql server?

543


Does partitioning improve performance sql server?

482


Explain collation?

618


How do I start sql server 2016?

519