A
Andreas Boehmer
This is what I want to do in Access:
I have got a table with categories. They have got a name and a categoryID:
categories (categoryID, name)
A related table uses the categoryID as a foreign key:
companyCategories (categoryID, companyID)
What I would like to do is display all the names of the categories, as well
as the amount of times the categoryID appears in the related table
(companyCategories).
So for example as a result of the search:
Hats, 4
Shoes, 5
Pencils, 23
The category Hats appears 4 times in the table companyCategories. Shoes
appears 5 times,...
I can't figure out how to write the SQL statement that joins both. Any
ideas?
I have got a table with categories. They have got a name and a categoryID:
categories (categoryID, name)
A related table uses the categoryID as a foreign key:
companyCategories (categoryID, companyID)
What I would like to do is display all the names of the categories, as well
as the amount of times the categoryID appears in the related table
(companyCategories).
So for example as a result of the search:
Hats, 4
Shoes, 5
Pencils, 23
The category Hats appears 4 times in the table companyCategories. Shoes
appears 5 times,...
I can't figure out how to write the SQL statement that joins both. Any
ideas?