Greets peeps, need an assist with a MySQL query updating with the sum of 2 columns.
TABLE1=Name,Age
TABLE2=Name,Age
What i want to do is update TABLE1.Age withe the combined value of TABLE1.Age & TABLE2.Age but cant seem to get it right?
Thought it would have been something along the lines of:
update TABLE1 set Age= sum(TABLE1.Age + Table2.Age) where Name='x';
But that gives a:
ERROR 1111 (HY000): Invalid use of group function
TABLE1=Name,Age
TABLE2=Name,Age
What i want to do is update TABLE1.Age withe the combined value of TABLE1.Age & TABLE2.Age but cant seem to get it right?
Thought it would have been something along the lines of:
update TABLE1 set Age= sum(TABLE1.Age + Table2.Age) where Name='x';
But that gives a:
ERROR 1111 (HY000): Invalid use of group function