更新时间:2023-02-03 07:41:03
只需要使用FROM"从正确的表中显示更新
Just needed the update to show from the correct table using "FROM"
UPDATE R1
SET R1.Points = 100 + ((100/((SELECT TOP 1 R2.Position FROM Results R2 WHERE R2.Date = R1.Date AND R2.ContestID = R1.ContestID ORDER BY R2.Position DESC)-4) * ((SELECT TOP 1 R2.Position FROM Results R2 WHERE R2.Date = R1.Date AND R2.ContestID = R1.ContestID ORDER BY R2.Position DESC)-R1.Position)))
From Results R1
WHERE R1.ContestID > 11
AND R1.Position > 4
AND R1.Position < (SELECT TOP 1 R2.Position FROM Results R2 WHERE R2.Date = R1.Date AND R2.ContestID = R1.ContestID ORDER BY R2.Position DESC)