I’m doing this in Chrome WebDB/SQLite
I have a members table and an answer table that a member may or may not have answered.
I am TRYING to get back a result set that includes the member name and answer they gave.. BUT if they didnt give an answer, I still want their name to come back.
Can someone try and help me on this?
SELECT m.LastName,
m.FirstName,
m.MiddleName,
s.surveyAnswer
FROM Members m
LEFT JOIN SurveyAnswers s
ON s.memberID = m.id
WHERE m.id = ?
AND s.eventID = ?
[results.rows.item(i).memberID, eventId],
This is what I try but still only receive the members who answered a question and is also in the SurveyAnswers table.
Make
s.eventIDpart of the join rather than theWHEREclause.Your select statement should look more like this: