Nested query

Thanks for giving it a shot. Unfortunatley it does not work.

here is something that does work(but it is from Microsoft Access database) I been getting a big chunk of my slq statements from Access since it is so quick to build. One thing I still have to learn is how to interpret it so mysql and php can work it.

first query is to select all the component a user has participated in. I get this by the following query and which becomes my nested query: called ‘userAttended’

SELECT fsattendances.attendee, fscomponents.componentTitle
FROM fsattendances LEFT JOIN (fstraining LEFT JOIN fscomponents ON fstraining.FSComponentId=fscomponents.id) ON fsattendances.fireSafetyId=fstraining.fireSafetyId
WHERE (((fsattendances.attendee)="userid"));

then I run another an “unmatched query” from the wizard and used the first query to compare it to.

SELECT fscomponents.componentTitle
FROM fscomponents LEFT JOIN userAttended ON fscomponents.[componentTitle] = userAttended.[componentTitle]
WHERE (((userAttended.componentTitle) Is Null));

and this works . I just don’t know how to join the two queries into one on my web page.

The logic as best as I can explain it goes like this:

I have users who attend fire drill every months. These users ID get inserted in the ‘fsattendance’ table along with the ID number of the particular drill they attended. This ID is generated from a report that is filled up after every fire drill and saved into a table called ‘firesafety’ along with the ID of the fire safety component that was practiced. The fire safety components are a bunch of exercise like fire exthinguisher operation, room search, radio communication and so on. Every month a different component or a combination of component are instructed to workers. So the fire safety report and the fire safety compnent gets saved as a record into a table called ‘fstraining.’ I have to use this type of logic in order to keep my tables “normal”