L
Lars Brownies
I have this table:
ID_car ID_category
1 10
2 10
2 20
2 30
3 20
I need to pull out the ID numbers which have values for all categories. So
in this example the result should be ID number 2. I can easily do this when
I would know the number of categories beforehand, in this case 3:
SELECT ID_carFROM tblTest GROUP BY ID_car HAVING (((Count(ID_category))=3));
How can I tackle this when I don't know the number of categories beforehand?
Can I do this in one query?
Thanks,
Lars
ID_car ID_category
1 10
2 10
2 20
2 30
3 20
I need to pull out the ID numbers which have values for all categories. So
in this example the result should be ID number 2. I can easily do this when
I would know the number of categories beforehand, in this case 3:
SELECT ID_carFROM tblTest GROUP BY ID_car HAVING (((Count(ID_category))=3));
How can I tackle this when I don't know the number of categories beforehand?
Can I do this in one query?
Thanks,
Lars