DELETE l.*,  c.* FROM quartup1.cialasielin AS l LEFT JOIN quartup1.cialasie AS c ON l.canal=c.canal AND l.cod_diario=c.cod_diario AND l.ejercicio=c.ejercicio AND l.num_asiento=c.num_asiento WHERE c.fecha>='20100101' AND c.fecha<='99991231'