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 / your name
Forget everything...Here it goes..in a simple way...
Select salary from tbl_name a where
n = (Select count(distinct(count(*))) from tbl_name b
where b.salary>=a.salary)
Substitute you value for n. thats all.
| Is This Answer Correct ? | 0 Yes | 1 No |
Post New Answer View All Answers
What is scalar user-defined function?
if you encounter this kind of an error message, what you need to look into to solve this problem? : Sql server database administration
What is coalesce in sql server?
Can we linked SharePoint to a SQL database?
What is the new security features added in sql server 2016? : sql server security
What are indexes in ms sql server?
What are policy management terms?
What is the syntax to execute the sys.dm_db_missing_index_details? : sql server database administration
How do I install sql server?
How do I clean up sql server transaction log?
What are user defined functions in ms sql server?
What is difference between rownum and rowid?
What are the advantages of stored procedure in sql server?
What do you understand by recursive stored procedures?
How can we rewrite sub-queries into simple select statements or with joins?