|
-
Hi kavitha,
It is not quite clear what you mean, but at a first glance it seems work for the decode function:
select sum(decode(ADVTISE_TYPE , 'sales',1,0)) sales_count
, sum(decode(ADVTISE_TYPE , 'wnated',1,0)) wnated_count
, sum(decode(trunc(addate,'ww'),trunc(sysdate,'ww'),1,0)) newentries_count
from TheTable;
when you want all weeks of the new_entries
it looks like the use of a union
select ??refdate xx
, sum(decode(ADVTISE_TYPE , 'sales',1,0)) sales_count
, sum(decode(ADVTISE_TYPE , 'wnated',1,0)) wnated_count
from TheTable
group by ??refdate
union
select trunc(addate,'ww')
, sum(newentries)
from TheTable
group by trunc(addate,'ww')
Regards
Ben de Boer
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|