What im looking for is to update a column from table 1 using the results from the SUM of a different column in table 2 for example :
table 1
id | views |
--------------------
1 | 0 |
2 | 0 |
table 2
show_id | views |
--------------------
1 | 5 |
1 | 10 |
1 | 10 |
2 | 10 |
2 | 10 |
2 | 10 |
Now the two tables are connected by id and show_id there the same value; what i want is to add the sum of views from show_id to id where show_id=id
so at the end table 1 should look like these :
id | views |
--------------------
1 | 25 |
2 | 30 |
I'm using MySQL 5.1.30