Anda harus melakukannya langsung di MySQL saat Anda melakukan kueri (jika mungkin):
SELECT DISTINCT Type, SUM(Price) as Total FROM table_name GROUP BY Type
Anda harus melakukannya langsung di MySQL saat Anda melakukan kueri (jika mungkin):
SELECT DISTINCT Type, SUM(Price) as Total FROM table_name GROUP BY Type