I'm doing this query
SELECT zip, COUNT(*) AS amount
FROM table
WHERE group_id = 19
GROUP BY zip ORDER BY amount DESC
This gives me a list with the number of occurrences of group_id 19 per zip-code. But I also want a total count of all groups_id's for every zip (without the WHERE clause). Like this (dummy code)
SELECT zip, COUNT(*) AS amount, COUNT(*) FOR THIS ZIP AS total, (amount/total * 100) AS percent
FROM table
WHERE group_id = 19
GROUP BY zip ORDER BY amount DESC
Is this possible?