troubleshooting Question

Update Set Column Query Not Working as Expected

Avatar of Ridgejp
RidgejpFlag for United Kingdom of Great Britain and Northern Ireland asked on
PHPMySQL Server
6 Comments1 Solution158 ViewsLast Modified:
Hi,

I have a table (holding_amazon) which contains orders from Amazon. I want to check that the "catID", the product SKU of the item, that was assigned to it when it was listed has no errors in the formatting by checking it's exists in another table (productCode) - this contains a list of approved SKU's.

I've written the following query which I thought would check that the SKU exists in the table "productCode" under the column "itemTitle" and if it is that it doesn't to set the value of "catID" to empty so that an exception report can pick it up later in the process.

update productCode, holding_amazon set holding_amazon.catID ='' where holding_amazon.catID <> productCode.itemTitle

When I test the above query it sets all the values for "catID" to empty even though 90% exist in "productCode" table ... what am I doing wrong?
ASKER CERTIFIED SOLUTION
Join our community to see this answer!
Unlock 1 Answer and 6 Comments.
Start Free Trial
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 1 Answer and 6 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros