how to find the second highest salary from emp table?
Answer Posted / chitti
Hi Viewers here is the simple query to find the highest
salary:-
1)Highest five salaries:-
select top 5 salary from employee order by salary desc
2)Highest 5th salary:-
select top 1 salary from(select top 5 salary from
employee order by salary desc) temp1 order by salary asc
3)Highest 4th salary:-
select top 1 salary from (select top 4 salary from
employee order by salary desc) temp1 order by salary asc
4)Highest 3rd salary:-
select top 1 salary from (select top 3 salary from
employee order by salary desc) temp1 order by salary asc
5)Highest 2nd salary:-
select top 1 salary from(select top 2 salary from
employee order by salary desc) temp1 order by salary asc
6)Highest 1st salary or highest salary:-
select max(salary) from employee
| Is This Answer Correct ? | 2 Yes | 0 No |
Post New Answer View All Answers
Is sql a backend language?
in oracle 10g sw after compiling procedure how to pass parameter values ,if we (v_empid out number)how to give empid after successful compilation program.This site exact suitable for 10g with respect to question & answer same format , im trying sql browser & sql command prompt using exec procedure name & respective parameters.
Is not equal in sql?
Is join same as left join?
what is uncommittable transactions? : Transact sql
What is set serveroutput on?
What is database sql?
i have some prob lem to tell me about my self in interview first round ...
What is pl sql record in oracle?
Are stored procedures faster than dynamic sql?
What is prepared statement in sql?
What is right join in sql?
Why is there a need for sqlcode and sqlerrm variables?
Which is the correct statement about truncate and delete?
How would you convert date into julian date format?