Hi
I have a query that I would like to return a different group by list dependent on a bind variable being passed in ? It seems easy but I cannot figure it out>
Example 1 if the :P380_COURIER_TYPE ='All' I would like the group by to be "group by tour" -- one column
Example 2 if the :P380_COURIER_TYPE <>'All' I would like the group by to be "group by tour,exp_del_channel" --2 columns
select
Tour as "Tour"
,Exp_del_channel as "Courier Type" -- this can be removed from the select statement as it is not required in the report.
,sum(pan_only) as "Pan Only"
from
VW_VOLUME_PREADVICE_REPORT vpa
where (:P380_COURIER_TYPE ='All' or exp_del_channel =:P380_COURIER_TYPE)
group by tour,exp_del_channel