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 / prashant narvekar
1. solution taken as std_id instead of salary
select max( b.std_id) from std_info a
inner join std_info b on a.std_id <> b.std_id
where a.std_id > b.std_id
2. solution
select max(std_id) from std_info
where std_id < ( select max(std_id) from std_info)
| Is This Answer Correct ? | 2 Yes | 5 No |
Post New Answer View All Answers
What is the difference between a clustered index and a non-clustered index?
How to change the password of a login name in ms sql server?
What is model database? : SQL Server Architecture
How and why use sql server?
How to concatenate two binary strings together?
What is the purpose of the tempdb database?
How to set a database state to offline in ms sql server?
Can we call stored procedure in trigger?
What are entities and relationships?
What is tempdb database? : SQL Server Architecture
What are the different ways you can create databases in sql server?
How to insert stored procedure result into temporary table?
What is table level trigger?
How does SSIS(Sql Server Integration Services) deffer from DTS(Data Transformation Services)?
What is sql server database?