Nope, that didn't work, it won't let you put a function in the distinct clause.
I think it will work though if you add a new column that does the decode on the table and substitued that "inner select with new column" for the straight table on the inner query. Does that make sense?
something like
select site_velocity, sum(totals) from
(
select site_velocity, count(distinct newcustkey) over (partition by site_velocity) totals
from
(select site_velocity, customer_key, decode(week_key,375,null,c
from sale_fact s, site_dimension site
where s.site_key = site.site_key
and where week_key between 375 and 427
)
)
group by site_velocity
Main Topics
Browse All Topics





by: RCorfmanPosted on 2006-02-15 at 16:08:55ID: 15966601
how about: stomer_key )) over (partition by site_velocity) totals
select site_velocity, sum(totals) from
(
select site_velocity, count(distinct decode(weekday,375,null,cu
from sale_fact s, site_dimension site
where s.site_key = site.site_key
and where week_key between 375 and 427
)
group by site_velocity
I didn't test this, just an idea to try...