where date(MYCOLUMN) = current date - 30 DAYS
But this query will be not optimal, because it will be indexscan by
mycolumn index.
If query is long rewrite it like
where MYCOLUMN >= timestamp(current date - 30 DAYS,'00:00') and
MYCOLUMN < timestamp(current date - 29 DAYS,'00:00')
Andy
Steve wrote:
delete from MYTABLE where date(MYCOLUMN) = current date - 30
"MYCOLUMN" is of type timestamp.
This query doesnt' work. Anything I missed here? I am hoping to
automate it on a daily basis. Anyone knows a better way to do it? Much
appreciated.