My question is, I wish to find the total average from the column "salery", and then change that result with everyone that has "Pettersen" as LastName?

Here is the workflow:

Step 1: Find average from salery.

Step 2: Change "Pettersens" salery with the average result.

Here is my approach, but it did not work, I got error: "#1111 - Invalid use of group function".

UPDATE products SET Salery = AVG(Salery) WHERE LastName='Pettersen';