I am trying to write a SQL query where I want to count the number of existence of Q1, Q2, Q3 and Q4 in Quarter. I have tried looking the previous questions but they weren't much clear. Here's my code:
SELECT
COUNT(Quarter CASE WHEN Quarter = 'Q1')
COUNT(Quarter CASE WHEN Quarter = 'Q2')
COUNT(Quarter CASE WHEN Quarter = 'Q3')
COUNT(Quarter CASE WHEN Quarter = 'Q4')
FROM office.office;
What am I doing wrong?