how do I use this query and import the results into the products table external code field?. Can someone help?
SELECT * , right(prod.productcode, len(prod.productcode) - LEN(sup.prefix) ) AS ExternalCoode
FROM MSLStore1_Products prod ,supplier sup
WHERE prod.suppid = 9217 AND prod.SgpID = 123 and sup.supno = prod.suppid
I have always been caught out by aliases in joins in updates (because I don’t think you can alias the target of the update), which is why I replaced the aliases with full names.