I'm trying to make a calculated value to show in another column in another table. Can someone please explain why this doesn't work
CREATE TABLE #Medition (ID int,AVG decimal(18,4))
INSERT INTO #Medition (ID, AVG)
SELECT ID, SUM(125Hz + 250Hz + 500Hz + 750Hz + 1000Hz + 1500Hz + 2000Hz + 3000Hz + 4000Hz + 6000Hz + 8000Hz)/11 AS AVG FROM tonvarden
UPDATE matningar SET matningar.tonmedelvarde =
#Medition.AVG FROM matningar INNER JOIN #Medition ON matningar.ID =#Medition.ID
DROP TABLE #Medition
I am getting this error
#1064 - You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'INSERT INTO #Medition (ID, AVG) SELECT ID, SUM(125Hz + 250Hz + 500Hz + 750Hz + ' at line 2