我有一个这样的表:
<表类>
Id
类型
价格金额 tbody><<tr>4284627 销售 307.800000 27.390000 4284640 卖307.8000002.670000 4284681 买 307.600000 0.480000 4284682 买 307.600000 1.960000 表类>
您似乎也想按type
分组:
select min(id), type, price, sum(amount)
from t
group by type, price;
但对于你的问题,这是有效的:
select min(id), min(type), price, sum(amount)
from t
group by price;