Anybody can tell me, how do we find second largest emp
salary from emp table.. Thanks in advance ...
Answer Posted / selvaraj anna university coe
Oracle 10g Using : Find 2nd Highest Salary?
SELECT * FROM emp e WHERE 2=(SELECT COUNT(DISTINCT salary)
FROM emp x
WHERE x.salary >= e.salary);
Answer :
EMP_NO EMP_NAME SALARY
--------- ------------------------- ---------
107 SARABOOT 550000
Is This Answer Correct ? | 10 Yes | 1 No |
Post New Answer View All Answers
How to increment dates by 1 in oracle?
What happens if variable names collide with table/column names?
How to work with data objects interactively?
Why does Oracle not permit the use of PCTUSED with indexes?
What is a subquery in oracle?
How we can able to import our own template (users designed MS-Word templates) which has many tabular columns; need to pass some values generate by Oracle-reports9i? Actually need to import more than 400 MS-Word templates into Oracle Reports-9i to minimize layout design in Reports.
What is the difference between substr & instr functions?
15. Display the item_cost and then truncate it to the nearest hundred, ten, unit, tenth and hundredth.
How remove data files before opening a database?
Explain the use of grant option in imp command.
Can you assign multiple query result rows to a variable?
What are the numeric comparison operations?
How to loop through a cursor variable?
How to add a new column to an existing table in oracle?
What is the difference between postgresql and oracle?