I try to do 2 delete queries in one. For example:
DELETE FROM `comments` WHERE `article_id` = 4;
DELETE FROM `aricles` WHERE `id` = 4;
I tried using a single query:
DELETE `articles`, `comments`
FROM `articles` INNER JOIN `comments`
WHERE `comments`.`article_id` = `articles`.`id` AND `articles`.`id` = 4
That works well if in table comments exist records with article_id 4, but doesn't remove articles records with articles.id = 4, if in comments records with article_id = 4 not found. Is there any way to do that?