I have a delete statement that is not doing what I want it to do:
Delete from LOG_TABLE where (DATE(LOG_TS)) < (DATE(CURRENT_D ATE)- 21
DAYS);
It is supposed to delete all records that are 21 days or older than the
current system date. Instead it is deleting all new rows. LOG_TS is a
timestamp but that should not matter since DATE returns just the date
portion of a date or timestamp...rig ht? I'm not a SQL guru but I can't
see anything wrong with this. I've looked thru the groups and checked
the IBM website but I can't find anything that addresses something like
this. Help!
Delete from LOG_TABLE where (DATE(LOG_TS)) < (DATE(CURRENT_D ATE)- 21
DAYS);
It is supposed to delete all records that are 21 days or older than the
current system date. Instead it is deleting all new rows. LOG_TS is a
timestamp but that should not matter since DATE returns just the date
portion of a date or timestamp...rig ht? I'm not a SQL guru but I can't
see anything wrong with this. I've looked thru the groups and checked
the IBM website but I can't find anything that addresses something like
this. Help!
Comment