I am getting the error message "table is ambiguous. I am using aliases so unsure why the table is ambiguous. Here is my code:
UPDATE Field_Translations
SET SourceColumn1='EnteredProduct'
,SourceValue1=I.Product
,TargetColumn1='NewProduct'
,TargetValue1='Not Reported'
,TargetColumn2='NewProductId'
,TargetValue2=-1
FROM Org8_28_17 I
LEFT JOIN Field_Translations FT ON I.Vendor=FT.SourceValue1 AND FT.SourceColumn1='HGVendor'
LEFT JOIN Field_Translations FT2 ON I.Product=FT2.SourceValue1 AND FT2.SourceColumn1='HGProduct'
WHERE FT.TargetValue1 IS NOT NULL AND FT2.TargetValue1 IS NULL --AND I.Product like '%(%'
AND I.Vendor=I.Product AND I.Vendor=FT.TargetValue1
If you alias the table name in the FROM clause, you must use the alias in the UPDATE clause:
UPDATE FT
Not
UPDATE Field_Translations
Your use of Field_Translations
is ambiguous because you have joined to it twice.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With