Answer to Question #25186 in Databases | SQL | Oracle | MS Access for Joe
I am trying to update a field in MySql:
the basic premis is:
FIeld X = Field Y + 30 (both X and Y are numeric)
Both fields are in the same table.
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?
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.
Dread it, run from it, the end of summer arrives all the same. And now it's here. It’s finally August.…
APPROVED BY CLIENTS
Thank you for your assistance. I received a 100% on my assignment. I was a little nervous about using this site, the reviews were not good, but I have to admit, I took a chance and I am so glad that I did. Math/Economics is not my specialty, I'm so glad that I came across this site. This is a true review. I will be using this site again. Fingers crossed that I continue to receive 100% on my assignments!