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 is database isolation in sql server? : sql server database administration
What command is used to rename the database?
What is a user-defined function in the sql server and what is its advantage?
Distinguish between nested subquery and correlated subquery?
What are views used for?
Explain the cursor lock types?
What is difference between index seek vs. Index scan?
Write a program using SQL queries to find a unique entry in a table.
how to take backup bcp out for a column in table in sql server?
What are the steps to follow to configure SQL*Net?
What is the library index called?
What is user-defined function? Explain its types i.e. Scalar and inline table value user-defined function?
What is model database in sql server?
What is ms sql server index?
Do you know how to store and query spatial data?