Problem and Solutions
Learning SQL, trying to figure out how to get a gender count in SQL ?
By M.K. Verma · 4 May 2022

with GenderTable AS
(
SELECT
CASE
WHEN 'Gender ID'=1 Then 'Female'
Else 'Male'
END AS gender
FROM CLIENT
)
SELECT count(gender), gender
FROM GenderTable
GROUP BY gender
;
You can try this too using the Common Table Expression