SUM, Getting Value Total

Syntax : SUM(field)

In MySQL, the Sum function is used to find the total value of a field in a table

Example:
SELECT SUM(Harga) AS TotalHarga FROM Barang;
SELECT Satuan,SUM(Harga) AS TotalHarga FROM Barang GROUP BY Satuan;



  

No comments:

Post a Comment