how to calcuate the second highest salary of he employee
Answers were Sorted based on User's Feedback
Answer / shailesh
select sal from emp where sal=(select max(sal) from emp
where sal<(select max(sal) from emp);
Is This Answer Correct ? | 0 Yes | 1 No |
Answer / jitendra
To get nth highest Salary, use below query
SELECT TOP 1 salary
FROM (
SELECT TOP nth salary
FROM Emp
ORDER BY salary DESC
) TmpTable
ORDER BY salary ASC
Replace nth with your number like second highest=2 4th=4 etc
Is This Answer Correct ? | 0 Yes | 3 No |
Answer / vivek ghorad
select min(select top(2)salary from emp)from emp;
Is This Answer Correct ? | 3 Yes | 9 No |
how to see the oracle 9i/10g table in pc? or In my pc where the table is saved and how to see?
what are myisam tables? : Sql dba
i don't want the message as 14 rows updated just it should update what it will do
hi,i plan to put experience on PLSQL ,can anyone suggest me for any institutes in bangalore or how to prepare for interviews
How to make a copy values from one column to another in sql?
Explain the commit statement.
What are the different types of PL/SQL program units that can be defined and stored in ORACLE database ?
declare l1 number := null; l2 number :=null; begin if l1=l2 then message('equal'); else if l1<>l2 then message('not equal'); else message('else'); end if; end if; end; What will be the output ?
what is a relationship and what are they? : Sql dba
function can return multiple value?how give give sample coding
2 Answers 3i Infotech, CTS, Excelity Global, UHG,
What are the rules to be applied to nulls whilst doing comparisons?
Can we use view in stored procedure?