Write a query to find second highest salary of an employee.
Answer Posted / rajasekhar.v
For selecting Nth highest salary...
SQL> select rownum rank,ename,sal from
(select ename,sal from emp order by sal desc)
group by rownum,ename,sal
having rownum = &n;
'n' may be any valid number required..
Is This Answer Correct ? | 1 Yes | 0 No |
Post New Answer View All Answers
What is $$ in sql?
Is sql procedural language?
What is an inner join sql?
what is 'trigger' in sql? : Sql dba
Is full outer join same as cross join?
What is difference between joins and union?
Can we use views in stored procedure?
What is the use of partition by in sql?
What is right join in sql?
what is meant by urlencode and urldocode? : Sql dba
Does user triggers have entry for trigger with compilation errors?
what is the command line end user interface - mysql? : Sql dba
What are the benefits of pl sql?
what is the maximum length of a table name, database name, and fieldname in mysql? : Sql dba
Why we use triggers in mysql?