writing a query to get the second highest value in atable by using select statement
writing a query to get the second highest value in atable by using select statement
Collapse
X
-
Tags: None
-
As you have posted a question in the articles section it is being moved to Oracle Forum.
MODERATOR. -
Originally posted by konaravikumarwriting a query to get the second highest value in atable by using select statementComment
-
Originally posted by konaravikumarwriting a query to get the second highest value in atable by using select statement
try this
select level,max(salar y) from emp1
where level=2
connect by prior salary>salary
group by level;
here salary->columnComment
-
Originally posted by konaravikumarwriting a query to get the second highest value in atable by using select statement
try this
select level,max(salar y) from emp1
where level=2
connect by prior salary>salary
group by level;
here salary->column nameComment
-
Originally posted by arulkumaraHi
try this
select level,max(salar y) from emp1
where level=2
connect by prior salary>salary
group by level;
here salary->column name
[code=oracle]
SELECT min(e.salary) FROM emp e WHERE 2 > (SELECT COUNT(*) FROM emp WHERE salary > e.salary)
[/code]Comment
Comment