hi guys,
am a bit confused as a have a table with a PK and FK using categories and sub categories tables.
The fk is the categoryID which is an int ( and not the name )
How do i get the count of the categories in the sub_cat table
here is my code
many thanks
SELECT dbo.Gifts_Category.CategoryName, COUNT(dbo.Gifts_SubCategory.SCName) AS 'mary'
FROM dbo.Gifts_Category INNER JOIN
dbo.Gifts_SubCategory ON dbo.Gifts_Category.CategoryID = dbo.Gifts_SubCategory.CategoryID
GROUP BY dbo.Gifts_SubCategory.SCName, dbo.Gifts_Category.CategoryName
_____________________
Yes O !