how to find the second highest salary from emp table?
Answer Posted / aravind naidu
select * from emp e where (select count(*) from emp where sal>=e.sal)=&n; put n = 2 for second highest sal,n = 3 for third highest sal ....and so on.
| Is This Answer Correct ? | 2 Yes | 1 No |
Post New Answer View All Answers
Is stored procedure faster than query?
What are the two virtual tables available at the time of database trigger execution?
Why do we use procedures?
What are the advantages of pl sql?
which operator is used in query for pattern matching? : Sql dba
Does sql backup shrink transaction log?
Describe different types of general function used in sql?
i have 2 table table one 4 columns respective values a1 7,a2 6,a3 8 ,a4 12 & table two 4 colums respective values a1 7,a2 6,a3 8,a4 15.if table one & table two 3 colums same then 4th column values 1)Qes diff >5 then print 5 * diff value 2)Que diff <5 print 5
What is dml and ddl?
What is scalar function?
Table A Table B 1 1 2 1 3 1. Union & union all --> A Union B , A Union all B 2. Minus , Intersect --> A minus B , B Minus A , A Intersect B 3. Joins A join B , A Left Join B A Right Join B , A full Join B 4. %Type - Uses & Benifit 5. Truncate & Delete 6. Pragma Autonomus Transaction 7. how to Perform DDL from function or procedure 8. Can we have DML inside Function 9. Rank & Dense Rank diffrence 10. Water Mark in Oracle 11. Index , Can we have index in all column of table if no then why ?
What is a recursive stored procedure?
What is sql injection vulnerability?
What is indexes?
How do I view output in sql developer?