Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Code Block
languagesql
DELETE support_tickets.*
FROM support_tickets
LEFT JOIN (

SELECT `st`.`id`
FROM `support_tickets` `st`
INNER JOIN `support_replies` `sr` ON `sr`.`ticket_id` = `st`.`id`
GROUP BY `st`.`id`
) t ON t.id = support_tickets.id
WHERE t.id IS NULL

...