问候语。我的问题是:我在表格中有一些值,如
SELECT * FROM items WHERE owner="Mark" AND object="apple";
+-------+-------+-------+-------+
| id | owner | object|amount |
+-------+-------+-------+-------+
| 12 | Mark | apple | 16 |
+-------+-------+-------+-------+
| 16 | Mark | apple | 3 |
+-------+-------+-------+-------+
| 34 | Mark | apple | 8 |
+-------+-------+-------+-------+
| 34 | Mark | apple | 0 |
+-------+-------+-------+-------+
并且任务是抓住第一个,总结给所有其他金额,然后删除其余的所以最终所有将像
+-------+-------+-------+-------+
| id | owner | object|amount |
+-------+-------+-------+-------+
| 12 | Mark | apple | 27 |
+-------+-------+-------+-------+