I want to remove some rows from table.
First, i tried to use subquery, but I can't remove data from table, when use the same table in subquery.
I tried do that in another way.
set @list_id_remove = (select group_concat(mra.media_id) from movie AS m
right join media AS mra ON m.id = mra.media_id
where m.id is null);
delete from media
where media_id IN (@list_id_remove);
But in this case query remove only 1 row. I think trouble - is that group_concat remove string and I need list of integers.