List:General Discussion« Previous MessageNext Message »
From:Paul DuBois Date:March 8 2003 4:06am
Subject:Re: update a value in a field.
View as plain text  
At 17:10 -0500 3/7/03, Christopher M Burger wrote:
>Hello everyone,
>
>I'm trying to write a query that would update a field in a table.  Here is
>the catch.
>
>Table 1 has two fields - field A and Field B
>Table 2 has two fields - field A and Field B
>
>Each table has many more fields but these are the only two I'm concerned
>with right now.
>
>Field B in table 2 is empty. Field B in table 1 is filled.  Field A is
>filled in both tables.  What I would like to do is set field B in table 2 to
>the value of field B in table 1 where field A in table 2 is equal to field A
>in table 1.
>
>Any help would be appreciated.
>
>Chris Burger
>
>

UPDATE t1, t2 SET t2.B = t1.B WHERE t2.A = t1.A;

Requires MySQL 4.0.2.
Thread
update a value in a field.Christopher M Burger8 Mar
Re: update a value in a field.Paul DuBois8 Mar