有两个表A和B
A表中有如下数据:
DANHAO JINE
001 100
001 200
001 300
002 400
002 500
B表中有如下数据:
DANHAO JINE
001 NULL
002 NULL
现在要在A表中按DANHAO汇总JINE,就是select sum(jine) as jine from A group by danhao,再把结果按单号对应单号插入到B表中
最终结果是
B表:
DANHAO JINE
001 600
002 900
请问SQL语句应该怎么写?