Answer the question
In order to leave comments, you need to log in
DELETE DATE_ADD Mysql query how to write correctly?
I need to make sure that messages that come in the form msg are deleted after 30 minutes from the last message sent, d is DATETIME.
mysql_query("DELETE FROM msg WHERE d <= DATE_ADD(d,INTERVAL -30 MINUTE)"); // Tried something x(
Thanks for the help!
Answer the question
In order to leave comments, you need to log in
DELETE FROM msg WHERE d <= DATE_ADD(SELECT MAX(d) FROM msg,INTERVAL -30 MINUTE)
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question