Hi all i have two tables
Projects
----------
ProjectID|ProjectNAme
1 |asdasd
2 |adas
3 |asdfdf
and
Bugs
-------
BugID|Title|ProjectID
1 |asda |1
2 |asdfs|1
3 |sdfsdf|2
4 |asfsd|2
now what i want is,to get the count of no of bugs the project has…and if the project doesnot has any bugs then i should get the count as 0..i had been trying this query…i dnt get the count 0 if projectID doesnot exist in Bug table can any one help me here
Select
P.projectName
, Count(B.BugID) As BugCount
from bugs B inner join projects P
on P.ProjectId = B.ProjectId
group by P.projectName
1 Answer