You probably want a multi table update assuming you are running at least
4.0.x.

Add the column(s) to A with an ALTER TABLE 

UPDATE A 
       INNER JOIN B 
       ON (.......
SET    A.col_name = B.col_name,
       A.col_name_2 = B.col....
WHERE  ......


You can copy the join structure from the FROM  section of your SELECT
statement and paste it in the UPDATE section and move the WHERE section
of the SELECT to the UPDATE.

-----Original Message-----
From: 2wsxdr5 [mailto:[EMAIL PROTECTED] 
Sent: Wednesday, January 11, 2006 11:30 AM
To: mysql@lists.mysql.com
Subject: [SPAM] - Adding data from one table to another - Bayesian
Filter detected spam

I have two tables with data on people in them.  Table A is a subset of 
table B,  However, there is data about these people in table B that is 
not in table A.  with a simple select I can do a join and get a result 
set with all the data I need to show, but what I would like to do is 
change table A so it also has one of the fields from table B.  Adding 
the field to table A is trivial , but how do I then populate that new 
field with data from the table B?

-- 
Chris W
KE5GIX

Gift Giving Made Easy
Get the gifts you want & 
give the gifts they want
One stop wish list for any gift, 
from anywhere, for any occasion!
http://thewishzone.com


-- 
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:
http://lists.mysql.com/[EMAIL PROTECTED]



--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:    http://lists.mysql.com/[EMAIL PROTECTED]

Reply via email to