To find second largest salary in Employee table
Answer Posted / ram
select *from emp e where &n in(select count(distinct sal)
from emp m where e.sal<=m.sal);
which will ask's u like :
enter the value for n : 2 (enter 2)
gives u second highest.
| Is This Answer Correct ? | 4 Yes | 0 No |
Post New Answer View All Answers
Name three of the features managed by the surface area configuration tool? : sql server security
How many types of local tables are there in sql server?
what are user defined datatypes and when you should go for them? : Sql server database administration
How to delete a database in ms sql server?
Can we call stored procedure in trigger?
What are date and time data types in ms sql server?
What do you understand by check constraint in sql server?
What is difference between after and before?
What does Master database contains?
What is table join?
What stored by the msdb? : sql server database administration
Explain query editor regions
Can a trigger be created on a view?
Explain trigger classes i.e. Instead of and after trigger?
What is transaction server auto commit?