Skip to Main Content

SQL & PL/SQL

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Interested in getting your voice heard by members of the Developer Marketing team at Oracle? Check out this post for AppDev or this post for AI focus group information.

partition by - where clause

763735Apr 7 2010 — edited Mar 21 2012
Hi,
I have to use a where clause within the partition by clause in my sql. Is it possible to use so?
The reason is - I am doing 3 partition by s in my select statement each having a different selection condition.
For eg.
It is something like this:
select a, b,
sum(sales) over (partition by area ) where area = 'North' ,
sum(sales) over (partition by zone ) where zone = 'XYZ',
sum(sales) over (partition by state) where state = 'MP'

from table

any shortcuts to do that?
I tried using having clause within the partition by clause but i guess it is not allowed.
Any suggestions, please help. Thanks.
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Apr 18 2012
Added on Apr 7 2010
6 comments
65,040 views