tortoisehalfbreed
Programmer
Hi everyone,
Am new to this place, so forgive me if this has been answered elsewhere (I couldn't find it).
I have 2 two tables with a one to many relationship.
Table1 - ID (PK) (the one side)
Table2 - ID (FK), FacilID (the many side)
I try and join the two tables like such...
"SELECT Table1.* FROM Table1 LEFT OUTER JOIN Table2 ON Table1.ID=Table2.ID WHERE (FacilID=29 AND FacilID=34)"
Now, for example, I only want to show the record where Table2 has facilid=29 and facilid=34. However, if the record on the many side only has a record where FacilID=29, the record still shows up. This shouldn't be the case. How do i get it to only show where the two items match.
I've tried every combination of OR and AND, tried all the different joins etc.. but cannot get it to do this.
I probably haven't phrased my question that well, so if you need more clarification, please ask.
Thanks in advance,
Stu
Am new to this place, so forgive me if this has been answered elsewhere (I couldn't find it).
I have 2 two tables with a one to many relationship.
Table1 - ID (PK) (the one side)
Table2 - ID (FK), FacilID (the many side)
I try and join the two tables like such...
"SELECT Table1.* FROM Table1 LEFT OUTER JOIN Table2 ON Table1.ID=Table2.ID WHERE (FacilID=29 AND FacilID=34)"
Now, for example, I only want to show the record where Table2 has facilid=29 and facilid=34. However, if the record on the many side only has a record where FacilID=29, the record still shows up. This shouldn't be the case. How do i get it to only show where the two items match.
I've tried every combination of OR and AND, tried all the different joins etc.. but cannot get it to do this.
I probably haven't phrased my question that well, so if you need more clarification, please ask.
Thanks in advance,
Stu