Du har felter navngivet forkert, men selvom du retter dem, er dette en fejl i MySQL
det vil ikke lade dig gøre det, hvis du ikke har en standarddatabase.
update test.object1 p
join (
select ur.id_object1, sum(ur.score * ur.weight) as total, count(*) as weight
from (
select lur.*
from (
select s.id_object1, s.id_object2, s.dt, s.score, 1 as weight
from test.score as s
join test.object1 as o1
using (id_object1)
where s.dt > o1.dt
order by
s.id_object1, s.id_object2, s.dt desc
) as lur
group by
lur.id_object1, lur.id_object1, date(lur.dt)
order by
lur.id_object1, lur.id_object1
) as ur
group by ur.id_object1
) as r
USING (id_object1)
SET p.total = p.total + r.total,
p.weight = p.weight + r.weight,
p.dt = now();
Problemet er specifikt for UPDATE
med dobbeltindlejrede forespørgsler og ingen standarddatabase (SELECT
eller enkelt-indlejrede forespørgsler eller standarddatabase fungerer fint)