from the table display the 2nd highest salary?
and also the least 2nd salay?
Answer Posted / narayana
select top 1 sal from (
select top 2 sal from Emp order by sal desc) as a order by sal asc
select top 1 sal from(
select top 2 sal from Emp order by sal ) ss order by sal desc
| Is This Answer Correct ? | 0 Yes | 0 No |
Post New Answer View All Answers
What is data block and how to define data block size?
Tell me what is difference between clustered and non clustered index?
what are isolation levels? : Sql server database administration
What are the advantages of using cte?
How sql server executes a statement with nested subqueries?
While migrating Microsoft SQL Server 2008 database to SQL Azure, what can be done to ensure the database connectivity does not degrade?
What does it mean to invest in the index?
how many layers of tcp/ip protocol combined of? : Sql server database administration
explain what is a deadlock and what is a live lock? How will you go about resolving deadlocks? : Sql server database administration
What are subqueries in sql server?
How can you stop stored procedures from recompiling?
Are null values the same as that of zero or a blank space?
Explain the types of indexes.
How to list all dsn entries on your local machine using odbc_data_source()?
What is indexing and its types?