Mysql SUM() Functions Query

The SUM() function returns the total sum of a numeric column.

To understand SUM function, consider an products table, which is having the following query.

Code

$sql = "SELECT SUM(price) FROM Products"; 
$result = mysqli_query($con,$sql);
while($row = mysqli_fetch_assoc($result))
{

}

Leave a Reply

Your email address will not be published. Required fields are marked *