how to find the second highest salary from emp table?
Answer Posted / susanta
select * from emp e1 where N-1 =
(select count(distinct sal)
from emp e2
where e2.sal > e1.sal)
for Nth highest salary.
Is This Answer Correct ? | 20 Yes | 11 No |
Post New Answer View All Answers
Why do we use subquery?
what is uncommittable transactions? : Transact sql
what is auto increment? : Sql dba
Name three sql operations that perform a sort.
What's the procedure?
1. is it possible to use the cursor atttibutes (%found ,% rowcount , %isopen , %notfound ) to our user defined cursor names ....... cursor cursor_name is select * from scott.emp if you use... cursor_name%found , %rowcount ,%isopen,%notfound...will it work... -------------------------- 2.what is the difference between the varray and index by table .. -------- 3. type type_name is table of number(8,3) index by binary_integer; identifier_name type_name; first , last , prior , next ,trim are the methods we can use it for the above type...simillary is there any way to apply for cursors... with thanks and regards..sarao...
what are the different type of sql's statements ? : Sql dba
Mention what does plv msg allows you to do?
What are the types pl/sql code blocks?
What are different categories of sql commands?
what is primary key? : Sql dba
What is the function that is used to transfer a pl/sql table log to a database table?
What does cursor do in sql?
Explain dml and ddl?
What is time based sql injection?