先做一个生成表查询
SELECT t1.Co_Number, count(*)+(select Mo_Number from tblMax_Mo) AS ListNo INTO ListNo
FROM [select Co_Number from tbl生产计划明细表 group by Co_Number]. AS t1 INNER JOIN [select Co_Number from tbl生产计划明细表 group by Co_Number]. AS t2 ON t1.Co_Number>=t2.Co_number
GROUP BY t1.Co_Number;
再做一个update更新
UPDATE tbl生产计划明细表 AS t1 INNER JOIN ListNo AS t2 ON t1.Co_Number=t2.Co_Number SET t1.Mo = t2.ListNo;