Delete entry from related tables
-
31-10-2019 - |
Question
I can not use InnoDB engine because of some dependency troubles in LuaSQL and PtokaX.
My current query is something like:
DELETE e.*, m.*
FROM entries e
INNER JOIN magnets m
ON m.eid = e.id
WHERE e.id = %d
where, %d
is an integer passed by the user. This query works if there is atleast one entry in the magnets
table related to the entries
table.
But, it fails when the entries
has no dependent row in magnets
table. Can I modify this query to perform deletion from both tables, independent of child-rows in magnets
? Or do I need to first check if a child exists and delete accordingly?
No correct solution
Licensed under: CC-BY-SA with attribution
Not affiliated with dba.stackexchange