Hi. I'm totally at a loss. I've spent practically all day trying to make this work, but I can't. I'd really appreciate any help.
I have the following sql statement:
tbl_1 - tbl_2 is a one-many relationship.
tbl_1 - tbl_3 is a one-many relationship.
I want the query to return all rows from tbl_1 where none of tbl_2.c equals 'thisValue'. But it doesn't.
EDIT:
Basically, if there are 2 or more tbl_2 rows connected, then even if one of the tbl_2.c fields equals 'thisValue', it returns the tbl_1 row it is connected to because there is a tbl_2.c field that doesn't equal 'thisValue'.
end of edit
I've also done tbl_2.c<>'thisValue' instead of tbl_2.c NOT IN ('thisValue'): same results.
Can anyone help please. I hope I've provided enough info.
Thanks in advance.
I have the following sql statement:
Code:
SELECT DISTINCT tbl_1.a
FROM tbl_1 JOIN tbl_2 ON tbl_2.a=tbl_1.a JOIN tbl_3 ON tbl_3.a=tbl_1.a
WHERE tbl_3.b IN ([a load of values]) AND tbl_2.c NOT IN ('thisValue')
GROUP BY tbl_2.a
tbl_1 - tbl_2 is a one-many relationship.
tbl_1 - tbl_3 is a one-many relationship.
I want the query to return all rows from tbl_1 where none of tbl_2.c equals 'thisValue'. But it doesn't.
EDIT:
Basically, if there are 2 or more tbl_2 rows connected, then even if one of the tbl_2.c fields equals 'thisValue', it returns the tbl_1 row it is connected to because there is a tbl_2.c field that doesn't equal 'thisValue'.
end of edit
I've also done tbl_2.c<>'thisValue' instead of tbl_2.c NOT IN ('thisValue'): same results.
Can anyone help please. I hope I've provided enough info.
Thanks in advance.
Last edited:
















