I have a Table A as follows:
ID NAME VALUE
1 abc 10
2 xyz 15
I have a TABLE B as follows:
ID VALUE_1 VALUE_2 VALUE_3 TOTAL YEAR
1 0 0 0 0 2012
2 0 0 0 0 2013
3 0 0 0 0 2012
I want to UPDATE all rows in Table B and SET VALUE_2 column to the VALUE in Table A
I started my query statement as follows:
$query_string = '
UPDATE Table_B
SET VALUE_2 = (SELECT...something should go here I think)
WHERE Table_B.year = "2013"
Thank you for helping
1 Answer