Categories: MSDN / DotNet / Java / Scripts / Linux / PHP Ask - La ask - La Answer

how do I update a table from another table?

Table_A
Column_1 Column_2
10 20

Table_B
Column_1
=Table_A.Column_1+Table_A.Column_2

I would like to just fill Table A with entries and
have Table_B entries "auto-fill" or maybe triggered.

I have tried:
UPDATE Table_B
SET (Column_1)=(Table_A[Column_1+Column_2])
WHERE(Table_A.id=Table_B.id)

But I get a syntax error and reading thru the manual I can't find an example
to follow with this "simple problem".BTW I'm using MySQL and it's online
manual.
[544 byte] By [jaime] at [2007-11-9 21:11:27]
# 1 Re: how do I update a table from another table?
Try something like this...

UPDATE Table1 B
FROM TABLE2 A
SET (Column_1)=(A.[Column_1+Column_2])
WHERE(A.id=B.id)

"jaime" <xmenehune@cox.net> wrote:
>
>Table_A
>Column_1 Column_2
>10 20
>
>Table_B
>Column_1
>=Table_A.Column_1+Table_A.Column_2
>
>I would like to just fill Table A with entries and
>have Table_B entries "auto-fill" or maybe triggered.
>
>I have tried:
>UPDATE Table_B
>SET (Column_1)=(Table_A[Column_1+Column_2])
>WHERE(Table_A.id=Table_B.id)
>
>But I get a syntax error and reading thru the manual I can't find an example
>to follow with this "simple problem".BTW I'm using MySQL and it's online
>manual.
>
>
sheryl kemp at 2007-11-11 23:50:53 >