문제

I have a table with a field end date. I would like that all rows that contain a record in the end date field get deleted when the date is passed.

Once I have the right msyql syntax/command, I can make a cron job from it.

Can anyone help me out? Thanks in advance!

도움이 되었습니까?

해결책

or something like this:

DELETE FROM db_table WHERE end_date<NOW() AND end_date IS NOT NULL

다른 팁

DELETE FROM table WHERE end_date IS NOT NULL

end_date field must be null for those records that should not be deleted.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top