find out the second highest salary?
Answer Posted / thananjayan
SELECT * FROM 'emp` WHERE salary < ( SELECT max( salary
)FROM emp ) ORDER BY salary DESC LIMIT 1
This is Mysql syntax, if you use Oracle just remove LIMIT 1
and put it ROWNUM=1;
| Is This Answer Correct ? | 1 Yes | 0 No |
Post New Answer View All Answers
How to write numeric literals in oracle?
How many objectname will be created for a single table drop function? Why 'flashback' query giving error "ORA-38312: original name is used by an existing object" while getting the table?
Explain a synonym?
Explain drop constraint oracle?
Why packages are used in oracle?
How to rename a column in an existing table?
How to drop an existing table in oracle?
Explain what are the uses of rollback segment?
How to call a stored function in oracle?
Why do you use stored procedures and state some of its disadvantages?
What's dateware house and what's clustor with practicle example
What happens to the data files if a tablespace is dropped?
Compare and contrast between sql and sql server and explain its various functions?
what are the advantages of running a database in archive log mode?
What is set verify off in oracle?