For the complete documentation index, see llms.txt. This page is also available as Markdown.
Creating new columns
Using Alias with Case and Sum
SELECT profession AS department,SUM(CASEWHENMONTH(birthday) =1THEN1ELSE0END) AS month_1,SUM(CASEWHENMONTH(birthday) =2THEN1ELSE0END) AS month_2,SUM(CASEWHENMONTH(birthday) =3THEN1ELSE0END) AS month_3FROM employee_listGROUP BY profession;