SELECT * FROM(
select fee_type as feeType, fee as fee FROM research_cost
where product_category_id = #{productId} ORDER BY fee_type,create_at DESC limit 1000) t GROUP BY t.feeType
主要就是先子查询排序 再分组
SELECT * FROM(
select fee_type as feeType, fee as fee FROM research_cost
where product_category_id = #{productId} ORDER BY fee_type,create_at DESC limit 1000) t GROUP BY t.feeType
主要就是先子查询排序 再分组