I'm trying to writing a query that return the table_name and partition_name whose count of that partition have a value of 0.
I've got the below query that return the SELECT COUNT() of the tables and its partition:
SELECT 'SELECT COUNT(*) FROM ' || TABLE_NAME || ' PARTITION (' || PARTITION_NAME || ');'
FROM user_tab_partitions
ORDER BY table_name;
These are some of the SELECT that return:
SELECT COUNT(*) FROM A5109713 PARTITION (PT5109713_201210);
SELECT COUNT(*) FROM A5109713 PARTITION (PT5109713_201104);
SELECT COUNT(*) FROM A5109713 PARTITION (PT5109713_201301);
The last one it's the only that return data:
COUNT(*) |
2430276 |
What I need is a query that return the table_name and partition_name of those who has no data. Something like this:
TABLE_NAME | PARTITION_NAME
A5109713 | PT5109713_201210
A5109713 | PT5109713_201104