How to get second highest salary from a table
Answers were Sorted based on User's Feedback
Answer / senthil
select max(sal) from emp where sal <(select max(sal) from emp)
| Is This Answer Correct ? | 13 Yes | 1 No |
Answer / srinivas
select * from emp m where(select count(distinct sal)+1 from emp s where s.sal>m.sal)=2
| Is This Answer Correct ? | 7 Yes | 3 No |
Answer / saiz
select min(salary)
from emp
where salary in ( select top 2 salary
from emp
order by salary desc);
| Is This Answer Correct ? | 3 Yes | 0 No |
Differentiate between syntax and runtime errors.
what tools available for managing mysql server? : Sql dba
What is an inconsistent dependency?
What is the differnce between view and materialized view
What is Materialized View? In What Scenario we Use Materialized View?
What does select * from mean in sql?
Types of backups ?
How to run sql*plus commands in sql developer?
Is postgresql a nosql database?
How many functions are there in sql?
What are the 3 modes of parameter?
How run sql*plus commands that are stored in a local file?
Oracle (3259)
SQL Server (4518)
MS Access (429)
MySQL (1402)
Postgre (483)
Sybase (267)
DB Architecture (141)
DB Administration (291)
DB Development (113)
SQL PLSQL (3330)
MongoDB (502)
IBM Informix (50)
Neo4j (82)
InfluxDB (0)
Apache CouchDB (44)
Firebird (5)
Database Management (1411)
Databases AllOther (288)