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