I have two tables.
The first one is called Protocols and contains the following columns:
ID (table key)
Name
The second is called ActiveProtocols and contains the following columns:
ID (table key)
ProtocolsID (foreign key to Protocols)
I want to create a dataset that will exclude all rows from Protocols that
are found in ActiveProtocols .ProtocolsID.
I have tried various ways to do this but haven't been successful.
The closest I have come to a solution is the following Theta Join:
SELECT Protocols.ID FROM Protocols
JOIN ActiveProtocols ON ActiveProtocols .ProtocolID <> Protocols.ID
This almost works. I initially get the excluded rows but then I also get
every row from Protocols too.
Thanks in advance,
Eric
The first one is called Protocols and contains the following columns:
ID (table key)
Name
The second is called ActiveProtocols and contains the following columns:
ID (table key)
ProtocolsID (foreign key to Protocols)
I want to create a dataset that will exclude all rows from Protocols that
are found in ActiveProtocols .ProtocolsID.
I have tried various ways to do this but haven't been successful.
The closest I have come to a solution is the following Theta Join:
SELECT Protocols.ID FROM Protocols
JOIN ActiveProtocols ON ActiveProtocols .ProtocolID <> Protocols.ID
This almost works. I initially get the excluded rows but then I also get
every row from Protocols too.
Thanks in advance,
Eric
Comment