MySQL Forums
Forum List  »  Newbie

Update table with join
Posted by: Andy Deans
Date: February 12, 2014 06:58AM

hi there,

I have tried numerous queries on my database but 0 rows affected.

Basically the Documents table has the ProductID's held in here.

so say they have 100 docs for a Product it would record the ProductID for in every Document entry.
This works fine.

issue is now we need to add in the productID into folders table as we now display folders for a product and then the documents beneath the folder. again query works but I need to update the new columns added in folders table to match the product ids from products table.

this runs but says 0 rows affected even though there are matches in the tables.

query I tried:

update folders
join Documents on
Documents.FolderID = folders.FolderID
set folders.folder_ProductID = Documents.products_ProductID

anyone see why it is not adding in the products ids associated with the documents to the folder entry?

many thanks

Options: ReplyQuote


Subject
Written By
Posted
Update table with join
February 12, 2014 06:58AM
February 13, 2014 11:13PM
February 13, 2014 11:39PM
February 14, 2014 06:43AM
February 14, 2014 10:31AM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.