I can't quite figure this out. This query works, but I'd like to add a column that shows the percentage of the total.
SELECT f.name AS Acc., count(h.fair) AS Count
FROM holes h
JOIN fair f ON f.fair_id = h.fair
GROUP BY f.name
This results something similar to:
| Acc. | Count |
|---|---|
| A | 5 |
| B | 6 |
| C | 4 |
| D | 5 |
I'd like to have it show
| Acc. | Count | Percentage |
|---|---|---|
| A | 5 | 25%. |
| B | 6 | 30%. |
| C | 4 | 20%. |
| D | 5 | 25%. |