Can I use 'LIKE' or % in IN parameters while using Pivot in oracle? -


the current output:

port    bandwidth   type  xe-5/1/0    29267   xe  xe-5/1/0    48154   xe  ge-4/0/0    443 ge  xe-3/0/0    28077   xe  ge-1/0/0    1032    ge  ge-1/0/6    2285    ge  xe-5/1/0        xe 

the query:

select * (select d.port,d.bandwidth dummy123 d d.bandwidth not null)  pivot (sum(bandwidth) totalbandwidth port in ( 'ge%' ,'xe%')) 

is there way use or % operator while using pivot?

no, can't. can use substr truncate string. e.g. try following:

select * (select substr(d.port,1,2) portmask,              d.bandwidth       dummy123 d d.bandwidth not null)  pivot (sum(bandwidth) totalbandwidth portmask in ( 'ge' ,'xe')) 

Comments