SELECT tid, products, prise, tcount, sum(prise*tcount) AS TotalFROM tb1GROUP BY tid, products, prise, tcount;