You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'CASE WHEN quantity.Quantity IS NULL THEN 0 else 1 END isBreak FROM newproducts J' at line 1