I am having some issues getting the results I want from a query.
Basically I have two tables. To keep things short and sweet ill use made up values
table a contains the field ID,Week
table b contains ID and type
Type can be either a 1 or a 0 and and the ID will match table A.
Table b can contain more than one entry for the same ID on table A with different types.
What I am trying to do is return all the ID's in table B that only contain a type of 0, for a specific week in table a. So if table B contains:
I would only need to return ID 2
I have tried something like this
select a.id, b.id from b inner join a on b.id = a.id where a.week = '22' and b.type = 0
This issue is that it will return ID 1 and 2 as ID 1 contains a 0?
I hope this is clear enough!
Thanks for any pointers or help