Click here to Skip to main content
15,867,704 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hello guys. I have a question about a query in AdventureWorks

i use HumanResources.Employee and these following fields
employeeid, birthdate
i want to know howmany employees burnt in every year
Posted
Updated 18-Nov-12 23:33pm
v2
Comments
Richard MacCutchan 19-Nov-12 5:33am    
burnt?

1 solution

I guess you ment born every year.
Count and Group by YEAR:

SQL
SELECT YEAR(BirthDate) As [Year], COUNT(*) as [Count]
FROM [HumanResources].[Employee]
GROUP BY YEAR(BirthDate)


Result:
Year	Count
1945	1
1946	3
1947	1
1948	1
1949	1
1950	10
1951	1
.....
 
Share this answer
 
v4

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900