Please can someone help me with the SQL syntax?. See attached dataset. I am trying to update the NULLS in 2019 for the Sales Type column with the same value as in 2020 for the relevant Customername. EG. Sales Type in 2019 needs to say Social for Customername ABC, as this is the corresponding value in 2020. This is just an example of a large table i have in a database. I tried this following script as advised by someone and it throws a syntax error.
UPDATE SalesMaster_bkup e SET [Sales Typ] = (SELECT [Sales Typ] FROM SalesMaster_bkup i WHERE e.customername = i.customername AND year = 2020) WHERE year = 2019