how to get second highest salary in SQL(as/4000

Answer Posted / selvaraj v , anna univ coe

SELECT * FROM Employee e
WHERE 2=(SELECT COUNT(DISTINCT Salary) FROM Employee x
WHERE x.Salary >= e.Salary);

Is This Answer Correct ?    4 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is the benefit of foreign key?

716


Can we update views in sql?

686


what is schema? : Sql dba

744


describe transaction-safe table types in mysql : sql dba

707


What is data types in sql?

710






what is the bond code in materialized view?

2687


How to display the current date in sql?

775


Does mysql_real_escape_string prevent sql injection?

693


Difference between table function and pipelined function?

768


Can unique keys be null?

665


Does group by remove duplicates?

754


What is the difference between functions, procedures, and packages in pl/sql?

710


what are the performance and scalability characteristics of mysql? : Sql dba

729


What is materialized view in sql?

653


How do you create a db file?

716