write query for fourth maximum salary from employee table

Answer Posted / ajay roy

The Correct answer is ---

select salary from employee aa
where 4=(select count(*)from employee bb
where aa.salary<=bb.salary)

Thanks Elumalai.k

Top Keyword returns the top(first) row not the max record

Is This Answer Correct ?    1 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What happens if you insert a duplicate key for the primary key column in ms sql server?

535


How do you run a trace?

522


Explain trigger and trigger types?

561


How to count rows with the count(*) function in ms sql server?

540


What is triggers and its types?

551






What is the current limitation of the size of SQL Azure DB?

102


How to download and install sql server 2005 books online?

545


Which trace flags are enabled in sql server?

530


What are the aggregate and scalar functions?

529


Where can you add custom error messages to sql server?

589


How to edit table in sql server 2017?

517


Explain transaction server auto commit?

539


What is perspective, have you ever created perspective? : sql server analysis services, ssas

503


What options are there to delete rows on the publisher and not on the subscriber? : sql server replication

685


Why people hate cursor?

735