find out the third highest salary?
Answer Posted / haneef
Best One
select top 1 * from test_emp where sal in (select top 3 sal
from test_emp order by sal desc) order by sal asc
or
It also work
select top 1 * from test_emp where sal in (select top 3 sal
from test_emp order by sal desc) order by sal asc
select top 1 MAX(sal),id from test_emp where sal < (select
max(sal) from test_emp where sal < (select max(sal) from
test_emp))
group by id,sal order by sal desc
| Is This Answer Correct ? | 0 Yes | 1 No |
Post New Answer View All Answers
How many types of tables are there in oracle?
How to create an initialization parameter file?
What is different types of joins?
What is recovery manager(rman) backup in Oracle?
How to create an oracle testing table?
How to rename an existing table?
How to assign query results to variables?
WHEN CURSOR MOVES FROM ONE FORM TO ANOTHER FORM, HOW MANY TRIGGER WILL BE FIRED AND WHAT ARE THEIR SEQUENCE?
Explain integrity constraint?
What is a static data dictionary in oracle?
How to drop an existing view in oracle?
How to get the Installed Oracle Version Information ?
> CREATE OR REPLACE FUNCTION FACTORIAL_1(factstr varchar2 ) 2 RETURN NUMBER AS 3 new_str VARCHAR2(4000) := factstr||'*' ; 4 fact number := 1 ; 5 BEGIN 6 7 WHILE new_str IS NOT NULL 8 LOOP 9 fact := fact * TO_NUMBER(SUBSTR(new_str,1,INSTR(new_str,'*')-1)); 10 new_str := substr( new_str,INSTR(new_str,'*')+1); 11 END LOOP; 12 13 RETURN fact; 14 15 END; explanation Above program?
Can we connect to ORACLE db using Windows Authentication?
How to create a new table by selecting rows from another table?