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
* Be the first to Make Comment