Skip to content Skip to sidebar Skip to footer

How I Get Or To Sum(if()) Mysql

i have a problem. I need to find out, how to put OR in this order: SELECT ROUND(o.`total_products` / c.`conversion_rate` - (SUM(IF(pa.wholesale_price = '0' , p.wholesa

Solution 1:

try

IF((pa.wholesale_price = "0") OR (pa.wholesale_price IS NULL)......

Solution 2:

IF(pa.wholesale_price = 0 OR pa.wholesale_price IS NULL, 
          p.wholesale_price, pa.wholesale_price)

or shorter:

IF(coalesce(pa.wholesale_price,0) =0, p.wholesale_price, pa.wholesale_price)

Post a Comment for "How I Get Or To Sum(if()) Mysql"