How to read 2nd highest sal from EMP table?

Answer Posted / b.kumar

-- USING MS SQL SERVER

SELECT TOP 1 FROM

( SELECT DISTINCT TOP 2 FROM EMP ORDER BY SAL DESC) EMP
ORDER BY SAL ASC

Is This Answer Correct ?    2 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Explain optimistic and pessimistic concurrency?

539


is there a column to which a default can't be bound? : Sql server database administration

535


How can we determine what objects a user-defined function depends upon?

512


how many triggers you can have on a table? : Sql server database administration

494


Tell me about joins in database system and explain each in detail.

593






What is a system database and what is a user database?

576


Explain what are partitioned views and distributed partitioned views?

579


How to delete a login name in ms sql server?

532


What is the difference between migration and upgradation in sql server?

602


What is normalization? What number of normalization shapes are there?

602


What happens if you are trying to access a schema not owned by you?

508


Are null values the same as that of zero or a blank space?

574


What is triggers and stored procedures?

512


Can truncate be rolled back?

537


Name three of the features managed by the surface area configuration tool? : sql server security

508