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 |
How do I debug a stored procedure?
Explain commit, rollback and savepoint.
what is inline command?
Can you rollback after commit?
What are the different types of joins and explain them briefly.
how to calculate the difference between two dates? : Sql dba
i have a word ***********hello********world******. I require a o/p **********hello world**********, Need to delete the middle stars.
What is the difference between a query and a report?
Is left join inner or outer by default?
What is a design view?
How to return multiple rows from the stored procedure?
Which is the correct statement about truncate and delete?
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)