I am unable to update 2 fields in a Table using UDPATE AND IF condition. Need help.
I have an invoice table where in If field Nos=0 I need to update field Qty from Capacity and field Nos=1 in the same table.
My sql statement is not working:
UPDATE INVDTLS_draft1 SET `Nos`=1, `Qty`=`Capacity` IF (Nos=0) WHERE id=id
error message:
#1064- 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 'IF (Nos=0) WHERE id=id' at line 1