I have 3 tables:
1st table: SURVEY (surveyid, surveyquestion,...)
2nd table: OPTION (surveyid, optionid, optionname,...)
3rd table: ANSWER (surveyid, optionid, answerid, answertime,...)
With this 3 tables, I have a 'Question of the week' on my webpage. Filling these tables (ANSWER for the votes) is not a problem, but I want a query for the result with these fields:
Surveyquestion, Optionname, number of answers for this surveyid and optionid.
So that I have in 1 query all my desired fields, and that I can code
Survey 1:
- Option 1 (34 votes)
- Option 2 (59 votes)
...
Can you help me with this query? I would start from the OPTION table, do an inner join on SURVEY, but the count(answerid) is not completly clear to me.
Thanks in advance,
(not so) Smarty
1st table: SURVEY (surveyid, surveyquestion,...)
2nd table: OPTION (surveyid, optionid, optionname,...)
3rd table: ANSWER (surveyid, optionid, answerid, answertime,...)
With this 3 tables, I have a 'Question of the week' on my webpage. Filling these tables (ANSWER for the votes) is not a problem, but I want a query for the result with these fields:
Surveyquestion, Optionname, number of answers for this surveyid and optionid.
So that I have in 1 query all my desired fields, and that I can code
Survey 1:
- Option 1 (34 votes)
- Option 2 (59 votes)
...
Can you help me with this query? I would start from the OPTION table, do an inner join on SURVEY, but the count(answerid) is not completly clear to me.
Thanks in advance,
(not so) Smarty