sql >> Base de Datos >  >> RDS >> Mysql

Elimine todas las filas que no tengan una identificación existente en otra tabla

DELETE table2 
FROM   table2 
       LEFT JOIN table1 
              ON table2.a_id = table1.id 
WHERE  table1.id IS NULL