Write a query to get 2nd maximum salary in an employee table ?
Answer Posted / anil_abbireddy
select * from emp a where 2=(select count(distinct sal)
from emp b where a.sal<=b.sal)
Is This Answer Correct ? | 44 Yes | 12 No |
Post New Answer View All Answers
How can you maintain the integrity of your database on instances where deleting an element in a table result in the deletion of the element(s) within another table?
Can we create foreign key without primary key?
which operator is used in query for pattern matching? : Sql dba
Is null operator in sql?
Difference between truncate, delete and drop commands?
Why primary key is required?
What is auto increment?
What is sql and how does it work?
What is difference between my sql and sql?
what is 'mysqlshow'? : Sql dba
What is a data definition language?
What is the difference between inner join and left join?
What is pl sql in oracle?
What is the difference between partition and index?
What is cost in sql execution plan?