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


Please Help Members By Posting Answers For Below Questions

List few advantages of stored procedure.

530


How do I clean up sql server transaction log?

562


Do you know the isolation level that sql server support?

522


Explain datetime2 data type in sal server 2008?

545


Your sql server is running out of disk space. You notice that there are several large files with ldf extensions what are these files?

609






Name and describe few console utilities for ssrs?

249


What are the different types of collation sensitivity in sql server?

578


List out the differences between the clustered index and non-clustered index in sql server?

498


Explain cdc and sql injection?

543


What is data set in report?

95


What is coalesce in sql server?

533


Can we call stored procedure in trigger?

542


Explain error and transaction handling in sql server?

495


Can you please differentiate between a primary key and a unique key?

528


What will be query used to get the list of triggers in a database?

541