Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Mysql if statement if one colum isn't empty, compare two others
- SELECT c.* FROM cca_coupons c
- JOIN cca_owners o ON o.id = c.owner_id
- WHERE o.id='1'
- AND IF c.max_redemptions != '0' THEN c.amount_generated >= c.max_redemptions
- SELECT c.*
- FROM cca_coupons c
- JOIN cca_owners o ON o.id=c.owner_id
- WHERE c.amount_generated >= c.max_redemptions
- AND c.max_redemptions <> '0'
Add Comment
Please, Sign In to add comment