I have a table with year/quarter partitions like '2010Q1, 2010Q2....'
I want to truncate all Q2 partitions in this table across all years.
I know I can do it by "alter table <table_name> truncate partition 2010Q2, 2011Q2, 2012Q2 etc.
But, I want to write a dynamic sql like:
alter table <table_name> truncate partitions in (SELECT partition_name FROM ALL_TAB_PARTITIONS
where table_owner = 'abcd'
and table_name = 'bcdef'
and partition_name like '%Q2'
I know the above query doesnt work, but is there a way to write this kind of query?