UPDATE INVMB
SET MB100 = 'Y', MB046 IN
(SELECT AVG(TD010)
FROM PURTD
GROUP BY TD004)
FROM INVMB JOIN
PURTD ON INVMB.MB001 = PURTD.TD004
WHERE MB001 > '83-31'
这段应该怎么写,谢谢!
两个表A和B,分别有字段a和b,c和d;现要根据表A当中的字段a,从表B中查询出c=a的所有记录,并且求出d的平均值,并将平均值赋给b.
谢谢!