A
Amy Blankenship
I have a query:
SELECT ResponseField.ResponseGroupID, ResponseField.ResponseFieldName,
PersonResourceResponse.PersonResourceResponseID,
PersonResourceResponse.ScenarioID, PersonResourceResponse.UserInput,
PersonResourceResponse.ResourceResponse, PersonResourceResponse.IsIrritated,
PersonResourceResponse.ResponseFieldID, PersonResourceResponse.PersonID
FROM PersonResourceResponse RIGHT JOIN ResponseField ON
PersonResourceResponse.ResponseFieldID = ResponseField.ResponseFieldID;
This works great...gives me all records in ResponseField and then the
matching values, if any, in PersonResourceResponse.
However, if I include the criterea WHERE PersonResourceResponse.PersonID = 3
or PersonResourceResponse Is NULL, I only get the (existing) records in
PersonResourceResponse where the PersonID is 3 or null. What I was
expecting is to get existing records, plus the records from ResponseField
that have no matches in the PersonResourceResponse.
I'm not exactly and SQL newbie, but I can't get my head around what's going
wrong here.
TIA;
Amy
SELECT ResponseField.ResponseGroupID, ResponseField.ResponseFieldName,
PersonResourceResponse.PersonResourceResponseID,
PersonResourceResponse.ScenarioID, PersonResourceResponse.UserInput,
PersonResourceResponse.ResourceResponse, PersonResourceResponse.IsIrritated,
PersonResourceResponse.ResponseFieldID, PersonResourceResponse.PersonID
FROM PersonResourceResponse RIGHT JOIN ResponseField ON
PersonResourceResponse.ResponseFieldID = ResponseField.ResponseFieldID;
This works great...gives me all records in ResponseField and then the
matching values, if any, in PersonResourceResponse.
However, if I include the criterea WHERE PersonResourceResponse.PersonID = 3
or PersonResourceResponse Is NULL, I only get the (existing) records in
PersonResourceResponse where the PersonID is 3 or null. What I was
expecting is to get existing records, plus the records from ResponseField
that have no matches in the PersonResourceResponse.
I'm not exactly and SQL newbie, but I can't get my head around what's going
wrong here.
TIA;
Amy