(IF(T5.coupon_code=XYZABC And T3.products_id=14,'5.00','0.00')) As Ded_promo2
This is causing an error because you are using XYZABC as a column name. Use it as a string:
(IF(T5.coupon_code='XYZABC' And T3.products_id=14,'5.00','0.00')) As Ded_promo2
Edit:
In response to your comments, you can include these in the same column but it's a bit messier:
(IF(
T5.coupon_code='XYZABC' And T3.products_id=14,
'5.00',
(IF(
T5.coupon_code='AnyotherCoupon' And T3.products_id='AnyotherID',
'CouponValue',
'0.00'))
)) As Ded_promo2,
So the above will show 5
if the code is XYZABC
and product id is 14
.
Otherwise if code is AnyotherCoupon
and id is AnyotherID
it will show CouponValue
.
If neither of these are the case then it will show 0.00
.
One thing to note that if there is a lot of these it would be better to store the promotion amount in the database (perhaps as a coupon table?). This keeps the SQL neater and allows you to more easily add and change coupons.