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
you have a table with close to 100 million records recently, a huge amount of this data was updated now, various queries against this table have slowed down considerably what is the quickest option to remedy the situation? : Sql server administration
Explain what are various ways to enhance the ssrs report?
What is the name of the Database which IBM mainframe uses?
Explain transaction server isolation?
How to fine-tune reports?
What is always encrypted?
What are the purpose of Normalisation?
What is an expression in ms sql server?
How to provide column names in insert statements in ms sql server?
What is the stuff and how does it differ from the replace function?
Can we deploy SSRS reports on our personal website?
Explain hostprotectionattribute in sql server 2005?
How can I check if a view exists in a sql server database?
What command do we use to rename a database?
What are the types of indexes?