How to find the second largest salary in the emp database and
also How to find 3rd,4th and so on ........ in the emp database
plz mail the answer @ mak2786@gmail.com
Answer Posted / pankaj arya
select top 1 sal from emp where empid in(select top 2 empid
from emp order by sal desc) order by
sal asc
if you want to get 3rd one than put 'top 3' in subquery and
same for 4th, 5th....
| Is This Answer Correct ? | 15 Yes | 14 No |
Post New Answer View All Answers
Why use stored procedures in sql server?
How can we check the sql server version?
what is database replicaion? What are the different types of replication you can set up in sql server? : Sql server database administration
What are the new features introduced in SQL Server 2000 (or the latest release of SQL Server at the time of your interview)? What changed between the previous version of SQL Server and the current version?
1.what is the diff between nolock optimizer and read uncommitted isolation? 2.what is the diff between revoke and deny? 3.what is percieved down time? 4.whether password protection are required for backups?if yes why?if no why? 5.what is fill factor? 6.what is cost analysis? 7.what is mean by piece meal restore? 8.what is 'rowguidcol'? 9.impersonate permission? 10.what is selectivity?
How you can add messages to the nt event log from within a stored procedure?
What is a linked server in sql server?
What are character string data types in ms sql server?
How to compose an inquiry to demonstrate the points of interest of an understudy from students table whose name begins with k?
Explain what is raid and what are different types of raid levels?
in the physical file layout, where should the transaction log be stored in relation to the data file? : Sql server administration
Can you explain what are various ways to enhance the ssrs report?
What are group functions in query statements in ms sql server?
your sql server is running out of disk space. You notice that there are several large files with ldf extensions what are these files? : Sql server administration
how you can deploy an ssrs report?