0 like 0 dislike
1 view
in Mysql by anonymous Bilge (165k points)
reshown by anonymous
mysql two table delete records from another table if not exsist

1 Answer

0 like 0 dislike
by anonymous Bilge (165k points)

 --

DELETE product 
FROM product
        LEFT JOIN
    kasadef ON kasadef.product_id=product.id
WHERE
    product.id IS NULL

--
DELETE FROM product WHERE NOT EXISTS(SELECT NULL
       FROM kasadef ks WHERE ks.product_id = product.id)    
...