Hard at work on our database project as evidenced by our group photo kindly submitted by Big Blog in the Sky, I am having trouble getting this three-table query to work correctly. The question we are trying to ask is "What services has the club provided to the AALC and what are the associated deliverables and resources?" Deliverables, resources, and project service all come from different tables and I have basically divided the query into three parts. Contained in each part is a nested query and each nested query displays the correct results when run separately. Any suggestions on how to get them to work simultaneously? The AND operator seems to be causing some problems.
Here is a copy of the query:
SELECT proj_concentration.service, proj_resources.r_filename, deliverables.d_filename
FROM proj_concentration, proj_resources, deliverables
WHERE proj_concentration.service IN
(SELECT DISTINCT proj_concentration.service
FROM proj_concentration
WHERE proj_concentration.org_ID = 'AALC')
AND WHERE proj_resources.r_filename IN (SELECT DISTINCT proj_resources.r_filename
FROM proj_resources, proj_services, proj_concentration
WHERE proj_resources.service = proj_services.service
AND proj_concentration.service=proj_services.service
AND proj_concentration.org_ID='AALC')
AND WHERE deliverables.d_filename IN
(SELECT DISTINCT deliverables.d_filename from deliverables
WHERE deliverables.org_ID IN
(SELECT org_ID from project WHERE Org_ID = 'AALC'));
Thanks for the help!