Beruflich Dokumente
Kultur Dokumente
You can download the products.sql file from our website. If you are new to MySQL you will need to
know how to Create a MySQL Table and Insert a MySQL Row.
SUM is an aggregate function that totals a specific column for a group. The "products" table that is
displayed above has several products of various types. One use of SUM might be to find the total of all
the items' price for each product type.
Just as we did in the aggregate introduction lesson, we are going to apply the aggregate function to
price and GROUP BY type to create four groups: Music, Toy, Clothing and Food.
PHP and MySQL Code:
<?php
// Make a MySQL Connection
Display:
Total Clothing = $67.47
Total Food = $8.73
Total Music = $45.53
Total Toy = $93.94
If you would rather download the PDF of this tutorial, check out our MySQL eBook from the
Tizag.com store. You may also be interested in getting the PHP eBook
Found Something Wrong in this Lesson?
Report a Bug or Comment on This Lesson - Your input is what keeps Tizag improving with time!
Web Reference
HTML Reference CSS Reference CSS Examples PHP Examples Help Tizag Grow
Link to Tizag
New - Tizag.com Forums!
Recent Forum Topics:
- HTML Frameset question - link to a new page
- Positioning and stretching problem
- Displaying mailbox name using PHP and IMAP
- Sending Html Code in Post !!
Advertise Here
More Tutorials!
Microsoft Office Tutorials Artist Tutorials
mayor
abram
fatalaiya
mayor
abram
fatalaiya