| proj_id | list_date | state | Status |
| 1 | 03/05/10 | CA | Finished |
| 2 | 04/05/10 | WA | Unfinished |
| 3 | 03/05/10 | WA | Finished |
| 4 | 04/05/10 | CA | Finished |
| 5 | 03/05/10 | WA | Unfinished |
| 6 | 04/05/10 | CA | Finished |
What query can I write so to determine the percentage of projects in each listing month and state are finished?
I currently have written the following code to group the amount of projects by its month and state
select
month(list_date), state_name, count (*) as Projects
from
projects
group by
month(list_date), state_name;
How do I then incorporate the percentage of projects in each listing month and state that are finished or unfinished?
Desired output:
| list_date | state | Proj_Count | % Finished
| March | CA | 2 | 10%
| April | WA | 3 | 20%
| July | WA | 6 | 50%
| August | CA | 5 | 40%