Find 2nd Highest salery in emp table
Select* from emp where &n=
select * count from emp where (salery >=emp.salery)
Enter n value 2
These query is correct or not. Tell me any other methods.
Answer Posted / lince
select top 1 * from (select distinct top 2 * from emp order by sal desc)t order by sal asc
| Is This Answer Correct ? | 1 Yes | 0 No |
Post New Answer View All Answers
What does select 1 mean?
What are the different types of lock modes in sql server 2000?
What is co-related sub query?
What is nolock?
Where are sql server usernames and passwords stored in the sql server?
What is blocking and how would you troubleshoot it? : sql server database administration
Why we need sql server?
What is the cartesian product of table?
What is the maximum size of sql server database?
What is clustered index
how would you troubleshoot blocking? : Sql server database administration
hi, how to link a text file and a .rpt file in my tables of sql server and to retrieve those records for further use. reply me as soon as possible.
What is an indexing strategy?
Differentiate between a having clause and a where clause.
Define right outer join in sql server joins?