Jump to content

SELECT COUNT


johnsmith153

Recommended Posts

Very simple - or I thought.

 

Imagine simply a 'value' field which holds 13 different values from "A" to "M" (and thousands of records).

 

I simply want to count how many of each exist.

 

COUNT(value) FROM $table WHERE value="A"

COUNT(value) FROM $table WHERE value="B"

COUNT(value) FROM $table WHERE value="C"

 

...would do it, but surely there is a better way as I need to check all 13 at the same time.

Link to comment
https://forums.phpfreaks.com/topic/216404-select-count/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.