| indra |
Posted: Jan 21, 2007 05:01:35 AM |
Total Post: 20
Joined: Jan, 2007
|
| How to see the maximum salary from emp table without using the max function? |
|
|
ron |
| Posted: Jan 21, 2007 10:42:46 AM | |
|
Total Post: 9
Joined: Nov, 2006
|
select salary
from emp
orderby salary desc;
this will generate an output with maximum salary at the top.
|
|
|
|
|
Jayanta |
| Posted: Jan 21, 2007 12:24:28 PM | |
|
Total Post: 479
Joined: Feb, 2006
|
u can take help of top n analysis.
with regards
jayanta
|
|
|
|
|
Muks |
| Posted: Jan 21, 2007 01:00:58 PM | |
|
Total Post: 36
Joined: Jan, 2007
|
Adding to what jayanta has suggested ...this way u can get it
select sal
from (select sal from emp
order by sal desc)
where rownum<=1;
Cheers!!
Mukta
|
|
|
|
|
sathish |
| Posted: Jan 22, 2007 03:46:47 AM | |
|
Total Post: 47
Joined: Mar, 2006
|
Use analytic function
select salary from (select salary ,dense_rank() over (order by salary desc) rno from emp) where rno = &n
/
row_number() or rank() .....
|
|
|
|
|
| Time Zone: EDT |
Send this thread to your friend |