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 / kavitha

select * from emp as a

where sal < 2 from emp as a1
on
(
a.idno=a1.idno
)

Is This Answer Correct ?    4 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Does group by sort data?

509


What is isolation levels?

562


Why we need to use secondry database file? though, we can do same work using primary database file also.

5753


What is attribute hierarchy? : sql server analysis services, ssas

512


Determine how to use the inserted and deleted pseudo tables?

525






Mention a few common trace flags used with sql server?

536


What do you understand by hotfixes and patches in sql server?

509


Explain what are magic tables in sql server?

533


How to delete exactly duplicate records from a table?

597


Write a query to include a constraint, to check whether the employee salary is greater than 5000?

1108


How to throw custom exception in Stored Procedure?

569


Explain the difference between clustered and non-clustered index?

531


What is the difference between stored procedure and user defined functions?

614


What is sql server used for?

546


How does stuff differ from the replace function?

546