I have a column call isDifFromother which is hold either 1 or 2 (default it is set to 0). when i updating a row, i want to set 2 if the isDifFromother value is having 0. if its having 1 i want to keep it as it is.
How can i check that condition inside my update query.
here is my query...,
UPDATE `customer` SET `name`='" + name + "', `isPackage`='" + packageID + "', `billing_ID`='" + biling_ID + "', `isDifFromother`=IF customer.isDifFromother = '1' THEN '2' END IF WHERE `id`='" + cusID + "';
but its embedded with errors.