I have the following query:
delete from customers_cards
where id not in (
select min(id)
from customers_cards
group by number_card )
and belongs_to = "ezpay"
It throws:
#1093 - You can't specify target table 'customers_cards' for update in FROM clause
I guess I need to use join
as a workaround, but honestly, I cannot rewrite the same logic with join. Any idea how can I write the query above with join
?