Hello,
I want to make delete post query and when I delete specific post I want to delete comments too. I’ve made query and it deletes posts only if that post have comments.
DELETE `p`, `c`
FROM `posts` AS `p`
INNER JOIN `comments` AS `c`
ON `p`.`id` = `c`.`post_id`
WHERE `p`.`id` = ?
How I can make query that deletes post event if there is no comments in it?