Find 2nd Highest salery in emp table

Select* from emp where &n=
select * count from emp where (salery >=emp.salery)


Enter n value 2


These query is correct or not. Tell me any other methods.

Answer Posted / r.rajivgandhi

Select max(salary) from emp where salary <(select max
(salary) from emp)

These Query is correct.Try It

Is This Answer Correct ?    0 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is command parameter in ssrs?

141


What is the usage of the sign function?

711


Can an entity have two primary keys?

725


How to include date and time values in sql statements?

809


How to start and end transact-sql statements?

748






Why is sql server log file full?

745


List out what other servers you can use with ssrs?

115


How to display a past time in days, hours and minutes?

741


What is the difference between set and select?

741


Explain the first normal form(1nf)?

750


How to add a new column to an existing table with "alter table ... Add" in ms sql server?

756


Is the order of columns in the set clause important in ms sql server?

709


Explain what is raid and what are different types of raid levels?

709


What is table constraint?

729


How to set database to be single_user in ms sql server?

764