Jump to content

Trying to UPDATE SET `table1`.`data` = (SELECT `table2`.`data`)


petroz

Recommended Posts

I have two tables of my vendor information. One has the addresses all on one cell, the other has all the info separated by address, city, state zip. I am trying to figure out how to update the new table with data from the old.

 

Here is my query.

UPDATE `vendors_test` SET `vendors_test`.`address_street` = (SELECT `old_vendors`.`vendors_addr1` from `old_vendors`) WHERE `vendors_test`.`id` = ( SELECT `old_vendors`.`vendors_id` FROM `old_vendors`)

 

Mysql is saying "Subquery returns more than 1 row" and I am a little lost now...

 

 

Any help or pointers would be greatly appreciated.

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.