2005/9/15, Dave <[EMAIL PROTECTED]>: > MySQL General List, > > Server specifications: > MySQL 4.1.3-beta, phpMyAdmin 2.5.7-pl1, PHP 4.3.8 > My specifications: > MySQL beginner, PHP intermediate, HTML and CSS advanced. > > The situation: > I have two tables, one old, and one new. In both tables I have a > column called "active", which is either 0 or 1, to denote whether a user > is to receive email or not. I am migrating all the data from the old > table to the new. > I want to make sure that the "active" column is identical, so I simply > want to copy the fields from the old table to the new, overwriting what > may exist in the new. I want to match the fields by using the member ID, > called "id" in the old table and "MEMBER_ID" in the new. > > This is the statement I thought would work. > UPDATE forum_members( active ) SELECT active > FROM members > WHERE forum_members.MEMBER_ID = members.id >
I'm sure other on the list will explain in details, but I'll do short. I understood that forum_members is the new table, members the old one. So : UPDATE forums_members,members SET forums_members.active=members.active WHERE forums_members.member_id = members.id -- Pooly Webzine Rock : http://www.w-fenec.org/ -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe: http://lists.mysql.com/[EMAIL PROTECTED]