Hi,
I have the followig SQL Query:
SELECT agd.fault_log.log_date, agd.parts.p_name, agd.part_categories.pc_prefix, agd.fault_log_actions.action_name
FROM agd.fault_log_actions, agd.fault_log, agd.parts, agd.part_categories
WHERE agd.parts.p_category=agd.part_categories.pc_id AND agd.fault_log.part_id=agd.parts.p_id AND agd.fault_log.action=agd.fault_log_actions.action_id;
It all works well apart from any rows in the agd.fault_log table with a value in the action column that doesn't exist in agd.fault_log_actions.action_id are not displayed.
I know it's down to this part of the query 'agd.fault_log.action=agd.fault_log_actions.action_id', but I dont know any other way to join the tables.
LEFT JOIN seems like it might do the trick, but i'm not sure how to implement it without losing the links to other tables.
Below are the tables relationships. The pinky red nodes indicate data that I want the query to output
Thanks
Matt
Edited 2 time(s). Last edit at 06/28/2010 04:43PM by Matthew Baker.