I am performing this request, and I get the results I want:
UPDATE sales
SET color = (
SELECT color
FROM master
WHERE productcode = "XJ2"
)
WHERE productcode = "XJ2";
But now I use a BI transformation tool where I can enter the constant ("XJ2" here) only once.
So I have to find an SQL request that does the same, but uses "XJ2" just once.
I feel some join is what I need, but I can't find a way to make it work (shame).
The point of this request is to retrieve the color of a product from a master table, to create a fully detailed table that I will use for data mining. Using MySQL, if that matters.