MySQL :: MySQL 3.23, 4.0, 4.1 Reference Manual :: 3.3.4.8 Counting Rows

การใช้ COUNT และ GROUP BY

SELECT COUNT(*) FROM pet;

SELECT owner, COUNT(*) FROM pet GROUP BY owner;

MySQL :: MySQL 3.23, 4.0, 4.1 Reference Manual :: 3.3.4.8 Counting Rows.

Advertisements