By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
440,581 Members | 1,990 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 440,581 IT Pros & Developers. It's quick & easy.

writing a query to get the second highest value in atable by using select statement

P: 1
writing a query to get the second highest value in atable by using select statement
Sep 12 '07 #1
Share this Question
Share on Google+
5 Replies


debasisdas
Expert 5K+
P: 8,127
As you have posted a question in the articles section it is being moved to Oracle Forum.

MODERATOR.
Sep 12 '07 #2

debasisdas
Expert 5K+
P: 8,127
writing a query to get the second highest value in atable by using select statement
Kindly post the query that you have tried to solve this.
Sep 13 '07 #3

P: 15
writing a query to get the second highest value in atable by using select statement
Hi
try this

select level,max(salary) from emp1
where level=2
connect by prior salary>salary
group by level;

here salary->column
Sep 19 '07 #4

P: 15
writing a query to get the second highest value in atable by using select statement
Hi
try this

select level,max(salary) from emp1
where level=2
connect by prior salary>salary
group by level;

here salary->column name
Sep 19 '07 #5

amitpatel66
Expert 100+
P: 2,367
Hi
try this

select level,max(salary) from emp1
where level=2
connect by prior salary>salary
group by level;

here salary->column name
Try below Query:

Expand|Select|Wrap|Line Numbers
  1. SELECT min(e.salary) FROM emp e WHERE 2 > (SELECT COUNT(*) FROM emp WHERE salary > e.salary)
  2.  
Sep 19 '07 #6

Post your reply

Sign in to post your reply or Sign up for a free account.