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 / prasant palo
with ttble as
(
select top 3 empid,empname,empsalary
from
emptable
order by empsalary desc
)
-- above will create a common table expression with name
--ttable
-- to know about it search for commontable expression
select top 1 empid,empname,empsalary
from
ttable
order by empsalary asc
| Is This Answer Correct ? | 2 Yes | 5 No |
Post New Answer View All Answers
How can you check the level of fragmentation on a table?
What is the difference between having clause and where clause in sql server?
What causes index fragmentation?
What happens if you are trying to access a schema not owned by you?
let's assume you have data that resides on sql server 6.5. You have to move it sql server 7.0. How are you going to do it? : Sql server database administration
How to generate random numbers with the rand() function in ms sql server?
How to recreate an existing index in ms sql server?
How to copy data from one table to another table?
Explain how you can deploy an SSRS report?
How to connect to a sql server using odbc_connect()?
You notice that the transaction log on one of your databases is over 4gb the size of the data file is 2mb what could cause this situation, and how can you fix it?
Explain the relational database management system (rdbms)?
Write down the syntax and an example for create, rename and delete index?
Can binary strings be used in arithmetical operations?
Explain the properties of a relational table?