how to get second highest salary in SQL(as/4000
Answer Posted / sreekanth
SELECT MIN(SAL)
FROM(SELECT DISTINCT SAL FROM EMP
ORDER BY SAL DESC)
WHERE ROWNUM <= :N
where n is the nth highest salary.
In most of the answers,our friends have written 'where
rownum=2',but this never retreives a row.
| Is This Answer Correct ? | 5 Yes | 2 No |
Post New Answer View All Answers
What is the difference between inner join and left join?
What is sap sql anywhere?
What is a natural join sql?
What company owns postgresql?
Which type of cursor is used to execute the dml statement?
how are mysql timestamps seen to a user? : Sql dba
What is the primary key?
Does pdo prevent sql injection?
Do stored procedures prevent sql injection?
column A column b | output 10 7 | 10 5 8 | 8 7 -9 | 7 3 5 | 5 0 6 | 6 Write a sql query to print such output.
What is dml with example?
what are all the different normalizations? : Sql dba
Does a primary key have to be a number?
What is snowflake sql?
How do I create a sql database?