02-25-04, 23:18 #1Registered User
- Join Date
- Feb 2004
I have tried this post in the PostgreSQL, but it is probably more specific to this forum. Sorry for any duplicates.
I have two tables one is a tasks table and the other an employees table. A third table I have is called participants. This third table holds the IDs of tasks and the IDs of employees assigned to complete those tasks. My problem is figuring out how to select employee IDs and names from the employees table that are not associated with a specific taskid in the participants table.
My first attampt was:
SELECT Employees.employeeid,Employees.username FROM Employees,Participants WHERE Participants.taskid=# AND Employees.employeeid!=Participants.employeeid.
#=any valid integer id in the taskid field of the Participants table.
This attempt just gave me everyone in the Employees table.
A more graphical representation of the tables:
Thanks for any input.
02-25-04, 23:58 #2Registered User
- Join Date
- Sep 2003
- The extremely Royal borough of Kensington, London
where id NOT IN
(Select id from tableB)Bessie Braddock: Winston, you are drunk!
Churchill: And Madam, you are ugly. And tomorrow, I'll be sober, and you will still be ugly.