This should be an easy query, but I'm having a heck of a time figuring it out.
I am trying to join two tables as follows:
SELECT ServiceMemo.*, ServiceMemoWork.*
FROM ServiceMemo, ServiceMemoWork
WHERE ServiceMemo.completed = 'yes'
AND ServiceMemoWork.serviceMemoID = ServiceMemo.id
AND ServiceMemoWork.reason != 'No Service'
There is a one-to-many relationship b/w ServiceMemo and ServiceMemoWork. I only want to join to ServiceMemoWork if NONE of the values on the ServiceMemoWork table are equal to "No Service", for the given ServiceMemoID. Currently, if one of the rows is not equal to "No Service", the join occurs.
Any help would be greatly appreciated!