I want to count a certain value in a column and output it as a number. Here is an example:
id | job |
---|---|
1 | police |
2 | police |
3 | ambulance |
Now I want to count the value "police" in the "job" column and make the result in a number, so because there are two entries with "police" in the column it would be as output the number two. With the value "ambulance" it is only one entry so the result would be 1.
Can anyone tell me how to write this as code? I have now searched a lot on the Internet and tried myself but I have found nothing that worked.