PHP and MySQL Programming/Common Functions and Operators

From Wikibooks, open books for an open world
Jump to: navigation, search

COUNT[edit]

mysql_query(" SELECT COUNT(*|`field_name`) FROM `table_name` ");

SUM[edit]

mysql> SELECT SUM(`field_name`) FROM `table_name`;

Previous: Basic Queries | TOC | Next: XML and PHP