更新时间:2023-01-29 16:19:07
You can delete from multiple tables in one query:
DELETE agenda.*, agendadatum.*
FROM agenda
JOIN agendadatum USING (idagenda)
WHERE tot < NOW();
This will delete rows from both agenda and agendadatum, and only those rows matching the conditions (same rows as returned by the query if you replaced DELETE
with SELECT
).