assume that the current user_id = 1
uc table
prod_id / user_id
102 / 1
103 / 1
cs table
prod_id / user_id
102 / 1
I want to find out 103, that is, those data that are available in the uc table but not in the cs table
SELECT
uc.prod_id
FROM `user_cart` as uc
JOIN `user_cart_stock` as cs ON cs.prod_id = uc.prod_id
WHERE uc.user_id = 1
AND cs.prod_id IS NULL
I find that writing like this doesn"t print anything?