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
Due to some maintenance being done, the sql server on a failover cluster needs to be brought down. How do you bring the sql server down?
Does sql server use java?
what is a schema in sql server 2005? Explain how to create a new schema in a database? : Sql server database administration
What new data source types were added in ssrs 2014?
What is the difference between the export /import functions in sql studio and standalone sql manager? : sql server management studio
Does an index slow down updates on indexed columns?
What are user-defined functions (udfs) in sql server?
When is update_statistics command used?
What is stored in the mssqlsystemresource database? : sql server database administration
What is the process of normalising?
How can we remove orphan records from a table?
How to create nested stored procedure?
Can we join two tables without primary key?
Why and when do stored procedure recompile?
explain the storage models of olap? : Sql server database administration