I have a MySQL question. It is related to this other question that I asked previously, but slightly different.
I have 2 tables: Teams, Contractors
TEAMS
|team_id | location|
--------------------
| 1 | space1 |
--------------------
| 2 | space2 |
--------------------
| 3 | space3 |
--------------------
| 4 | space3 |
--------------------
CONTRACTORS
|cont_id | location| team_id|
-----------------------------
| 1 | space1 | 1 |
-----------------------------
| 2 | space1 | 0 |
-----------------------------
| 3 | space3 | 3 |
-----------------------------
| 4 | space3 | 3 |
-----------------------------
| 5 | space3 | 0 |
-----------------------------
| 6 | space3 | 4 |
-----------------------------
If I'm given a team_id, I would like to create a query that finds all the contractors that are at the location of the given team_id AND belong only to the given team_id or with a team_id = 0. (team_id = 0 in the CONTRACTORS table means the contractor is not currently part of a team).
For example, I'm given the team_id = 3. The team with team_id = 3 is located at space3. I want to find the contractors that are located at space3 and belong only to team_id = 3 or team_id = 0 (cont_id = 3, 4, 5 in this example).
Is there a way to achieve this with a single MySQL query?

