alexa
Facebook
Twitter
LinkedIn
Instagram
Whatsapp
Call Now
Quick Inquiry

Learning SQL, trying to figure out how to get a gender count in SQL ?

Learning SQL, trying to figure out how to get a gender count in SQL ?
 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


39 0
7

Write a Comments


* Be the first to Make Comment

GoodFirms Badge
GoodFirms Badge

Fix Your Meeting With Our SEO Consultants in India To Grow Your Business Online