SQL SERVER||Stored Procedure to get Gender count from a table

Published: 19 February 2023
on channel: LearnSQLtoSSIS
131
2

Stored Procedure to get gender count from a table

ALTER Procedure GetGenderCount
@gender nchar(1),
@gendernew nchar(1)
AS
SELECT SUM(CASE WHEN gender='M' THEN 1 ELSE 0 END) AS Male_Count
,SUM(CASE WHEN gender='F' THEN 1 ELSE 0 END) AS Female_Count
FROM [Persondata$]
WHERE gender = @gender OR gender = @gendernew
GROUP BY gender

EXEC GetGenderCount M,F


On this page of the site you can watch the video online SQL SERVER||Stored Procedure to get Gender count from a table with a duration of hours minute second in good quality, which was uploaded by the user LearnSQLtoSSIS 19 February 2023, share the link with friends and acquaintances, this video has already been watched 131 times on youtube and it was liked by 2 viewers. Enjoy your viewing!