Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

update tbl X using data from table Y

Status
Not open for further replies.

iam288

Programmer
Feb 17, 2002
1
HK
Hi guys,

I've got a problem. Any suggestion??

update t1, t2
set t1.txt = t2.txt
where t1.id = t2.id;

I've tried this code in Access and it did work well but not for MySQL at
all.
 
Nope - you can't do this in MySQL (yet). A workaround is to do a CREATE TABLE SELECT then replace your old table with the new one

-Rpb
 
u could also use update <tablename> set <whatever> where <whatever>

am i right?
 
never mind that, i didn't realize it was two different tables...rob's suggestion will do it

arif
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top