I have the following SQL statement:
SELECT tblPlayers.name
FROM tblPlayers INNER JOIN
tblTeamMembers ON tblPlayers.PID = tblTeamMembers.PID
2 of the 5 players in the database are currently on a team. That is the result I get from the query. I'm trying to fill a List of players who are NOT currently on a team. So basically, I need the inverse of my sql statement.
tblPlayers holds player info, and tblTeamMembers holds TeamID and PlayerID (TID,PID).
I guess I can also explain it this way...
Current Players in Database:
Bill
Joe
Dan
Ted
Jim
Players ALREADY on a team are:
Dan
Ted
How can I rewrite my query so I can find out whose NOT on a team. The result would be:
Bill
Joe
Jim
instead of:
Dan
Ted
I think I need to add is NULL somewhere, but I can't get it to work.
Can any SQL guru help me out?
RESOLVED!!
SELECT tblPlayers.name
FROM tblPlayers INNER JOIN
tblTeamMembers ON tblPlayers.PID = tblTeamMembers.PID
WHERE WHERE (tblTeamMembers.BID IS NULL)