azzazzello
Technical User
Greetings,
I have a very specific question. I have 2 tables. One of them has an ID column and, say, 2 other data columns. The other table has ID as a foreign key that relates to first table's ID, except that it is not unique, and multiple entries can have the same ID in the second table. Basically,
Table 1
ID | Name | Age
1 | John | Doe
2 | Alex | Smith
Table 2
ID | job
1 | programmer
1 | manager
1 | director
2 | programmer
2 | manager
2 | salesman
I want to make a query that will give me all rows from table 1 and 2, where a person is NOT a director. I do NOT want to see ANY information on the person if one of his responsibilities is being a director. Basically, in the above example, I want 3 rows returned (joins are fine) based on the excluding directors from the resultset:
Alex Smith programmer
Alex Smith manager
Alexa Smith salesman
I am having trouble constructing such a query without subqueries (nested selects) as my version of Mysql does NOT support subselects (yet). Can anyone help?
I have a very specific question. I have 2 tables. One of them has an ID column and, say, 2 other data columns. The other table has ID as a foreign key that relates to first table's ID, except that it is not unique, and multiple entries can have the same ID in the second table. Basically,
Table 1
ID | Name | Age
1 | John | Doe
2 | Alex | Smith
Table 2
ID | job
1 | programmer
1 | manager
1 | director
2 | programmer
2 | manager
2 | salesman
I want to make a query that will give me all rows from table 1 and 2, where a person is NOT a director. I do NOT want to see ANY information on the person if one of his responsibilities is being a director. Basically, in the above example, I want 3 rows returned (joins are fine) based on the excluding directors from the resultset:
Alex Smith programmer
Alex Smith manager
Alexa Smith salesman
I am having trouble constructing such a query without subqueries (nested selects) as my version of Mysql does NOT support subselects (yet). Can anyone help?