UPDATE a,b
SET a.Price = AVG(
a.Price + b.Price
)
WHERE
a.id = b.id;
这样写 会报错 。如何求均值?
难道这么写? a.Price =
a.Price/2 + b.Price/2
update (select a.price aprice,b,price bprice from a left join b on a.id=b.id) c set c.aprice=avg(c.aprice+c.bprice)
update (select a.price aprice,b,price bprice from a left join b on a.id=b.id) c set c.aprice=avg(c.aprice+c.bprice)
你复制粘贴啊???