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

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s