You can't specify target table 'invoice' for update in FROM clause
DELETE FROM invoice WHERE id IN(
SELECT invoice.id
FROM invoice invoice
LEFT JOIN accounting accounting ON accounting.invoice_id=invoice.id && accounting.type_id IN (3,4)
WHERE invoice.group_id='1' && accounting.id IS NULL
)
hvis jeg tager select query'en for sig selv er der ingen fejl?