I want to delete some records based on records that I got from other query. Problem is that I have syntax error that I can't solve.
Here is query that I am using:
DELETE FROM `tickets` as c
WHERE c.TICKET_ID IN ( SELECT a.TICKET_ID
FROM `tickets` as a
INNER JOIN `old_tickets` as b
ON b.TICKET_ID = a.TICKET_ID);