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
Is postgresql a server?
when MSQL8.0 is in market
What is rowid in sql?
What is dcl in sql?
What is a rank in sql?
Can you sum a count in sql?
what is unique key constraint? : Sql dba
Why partition by is used in sql?
Can we insert data in view?
What are the types of keys?
how to decrement dates by 1 in mysql? : Sql dba
how to use 'mysql' to run sql statements? : Sql dba
What is before and after trigger?
What is case function?
Write an sql query to select all records from the table?