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 / kb
select top 1 * from emp
where sal < (select max(sal)from emp)
order by sal desc
| Is This Answer Correct ? | 3 Yes | 0 No |
Post New Answer View All Answers
Can sql servers linked to other servers?
Why union all is faster than union?
How many types of subqueries are there in sql server?
What is difference between commit and rollback when used in transactions?
What are different types of subquery?
Can you get second highest salary from the table?
Write a program to fetch first 10 records from a file?
What is primary key and example?
What are the advantages of policy management?
How to create user messages with print statements in ms sql server?
What is mean by candidate key?
what protocol both networks use? : Sql server database administration
Is sql server free?
What are the different index configurations a table can have?
Explain transaction server distributed transaction?