I tried update <tablename> set X = (Y+30) where condition = Z
I then tried update <tablename> set X = sum (Y+30) where condition = Z
both failed. Can you help?
1
Expert's answer
2013-02-27T04:17:46-0500
There are some rules for updating field in MySQL table: & 1. At the update moment table must exists in database 2. if X-field has PRIMARYor UNIQUE& key property - You must exclude inserting of duplicate values into that field, or have to use syntax: "UPDATE [IGNORE] tbl_name...". So duplicate values will be excluded and update will execute without an error messages. 3. Table names used with schema name, so Your sql-command must has format as:
update schema_name.tablename set X = (Y+30) where condition = Z & 4. Check - You have enough DB rights to update tables.
Comments
Leave a comment