Hi All -
How would I drop a partition if i need to calculate against the current date?
So far I have
if you always want to drop the first partition (the one two days ago) you could simply use
WHERE PARTITION = 1;
every day. But never run it two times on a singe day :-)
Otherwise I would simply
DELETE FROM XBITbls.FctBlgAcctSvcPrc_PARTITION
WHERE PartitionDt = CURRENT_DATE - 2;
without dropping the partition.
Empty partitions don't have any overhead.
Follow up question, Dieter...
If I wanted to go the route of dropping the partition, instead of doing the delete, could i compare the PARTITION level against a date? Similar to
PARTITION = 1 AND PartitionDt = CURRENT_DATE -1;
Would this work?