MySQL Query – List Records That Don’t Exist From Another Table

MySQL Query – List Records That Don’t Exist From Another Table

Suppose you want to retrieve a list of products that are not in promotion. SELECT * FROM product t1 LEFT JOIN promo_product t2 ON t1.idProduct = t2.product_idProduct WHERE t2.idPromoProduct IS NULL

May 17, 2020 · John Pili