The MySQL command line client should also do it.
Something like this (Didn't test it! I'm using SQL Server):
Something like this (Didn't test it! I'm using SQL Server):
Code:
mysql -uroot -p MyTvDb -e "DELETE FROM groupmap WHERE NOT EXISTS (SELECT * FROM channel WHERE channel.Idchannel = groupmap.Idchannel)"