A quick MySQL snippet to count how many times a value appears in a single field—much easier to grok than multiple JOIN
s.
SELECT
COUNT(CASE WHEN meta_value = 'value1' THEN 1 END) AS value1,
COUNT(CASE WHEN meta_value = 'value2' THEN 1 END) AS value2
FROM wp_post_meta;
/** Results
| value1 | value2 |
|--------|--------|
| 75 | 56 |
*/