MySQL Error Occured
1064: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near '|| (sale_price>= AND sale_price>0) ) ORDER BY CubeCart_inventory.productId D...' at line 1

QUERY = SELECT DISTINCT blackfriday, ekptwtiki_price, youtube_id, show_on_cat, price1, man, CubeCart_inventory.cat_id, CubeCart_cats_idx.productId, productCode, quantity, image, image1, price, name, sale_price, stock_level, useStockLevel FROM CubeCart_cats_idx INNER JOIN CubeCart_inventory ON CubeCart_cats_idx.productId = CubeCart_inventory.productId WHERE CubeCart_cats_idx.cat_id IN (245) AND active='1' AND (price>= || (sale_price>= AND sale_price>0) ) ORDER BY CubeCart_inventory.productId DESC, productId DESC