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 stored procedure would you use to view lock information? : Sql server administration
what is sql server? : Sql server database administration
What is a subquery in a select query statement in ms sql server?
What is impersonation? What are the different impersonation options available in ssas? : sql server analysis services, ssas
How much space does sql server 2016 take?
What is hierarchy, what are its types and difference between them? : sql server analysis services, ssas
What is the contrast between sql and mysql?
What to perform pattern match with the like operator?
What are examples of triggers?
Can we use pragma autonomous_transaction in trigger?
Does dbcc checkdb requires db to be in single_user mode? : sql server database administration
What will be query used to get the list of triggers in a database?
Can we return Data from 4(more than 1) tables in stored procedure?
Tell me the use of keyword with encryption. Create a store procedure with encryption?
Define constraints and give an example of their use?