I have two tables in a firebird 1.5 database, the tables are client and notes, in the notes table there can be multiple records for each corresponding record in Client table, and sometimes none.
The tables are structured like
Client
Client_id name
-----------------
1 Sam
2 Lee
3 Steve
4 Linda
5 Sue
6 Jill
7 Jack
Notes
Notes_id client_id Note
------------------------------
1 1 New
2 1 do not send
3 2 old
4 2 likes
5 4 do not send
6 5 new
7 5 Cats and Dogs
8 5 drives
I would like to run a select statement that would only return records from the Client table where there is no note named ‘do not send’ linked to the client in the notes table. So with the above examples the select statement would only return the following records from the client table.
Client_id name
-----------------
2 Lee
3 Steve
5 Sue
6 Jill
7 Jack
Is this possible? Any assistance with this would be appreciated.
Regards Alan
Below are three queries that will do the task:
or
or