我正在尝试根据cid
同一张表在新表中获取成人和儿童的总和。
餐桌销售
+-----------+------------+---------------+
| cid | adult | child |
+-----------+------------+---------------+
| 1 | 20 | 20 |
| 1 | 30 | 10 |
| 1 | 100 | 35 |
| 1 | 10 | 25 |
| 2 | 40 | 10 |
| 2 | 20 | 70 |
| 2 | 30 | 60 |
+-----------+------------+---------------+
所需的输出:
+-----------+------------+---------------+
| cid | adult | child |
+-----------+------------+---------------+
| 1 | 160 | 90 |
| 2 | 90 | 140 |
+-----------+------------+---------------+
请帮帮我