how to find the second highest salary from emp table?
Answer Posted / priya
select sal from emp where sal <(select max(sal) from emo)
and rownum<2 order by desc
though rownum which is a pseudo column can be used for
comparisions with relational operators like > or < ,>=, <=
but equalto = may not work in most of the cases..
similarly rowid also.
| Is This Answer Correct ? | 0 Yes | 1 No |
Post New Answer View All Answers
What can I use instead of union in sql?
Is a foreign key always unique?
How many tables can a sql database have?
What are different types of triggers?
What is pl sql variable?
Is join and inner join the same?
What steps server process has to take to execute an update statement?
How do you optimize a stored procedure query?
What is cte?
Define implicit and explicit cursors.
Can triggers stop a dml statement from executing on a table?
What type of join is sql join?
Where the sql database files are stored?
How to call a javascript function from pl sql?
Why procedure is used in sql?