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
Why we use functions in sql server?
What is a transact-sql statement?
Indexes are updated automatically is the full-text index also updated automatically?
What is log shipping?
What is instead of trigger sql server?
What are the differences between triggers and stored procedures?
What have included columns when we talk about sql server indexing?
What are the differences between sql server and mysql.
Explain an automatic checkpoint
what is a mixed extent? : Sql server administration
How you can get the list of largest tables in a database?
Explain boyce and codd normal form(bcnf)?
Do you know the cursor types?
What is the difference in accessing db between sql server vs sql azure?
how you can get the list of largest tables in a database? : Sql server administration