wanttoscript
IS-IT--Management
I conduct the following 2 queries to get my answer set:
CREATE TEMPORARY TABLE temp_table
SELECT call_info.call_id, answers.answer
FROM answers INNER JOIN call_info ON answers.call_id = call_info.call_id
WHERE answers.question=1;
SELECT COUNT(temp_table.call_id) as cid, temptable.answer as A, answers.answer as B
FROM answers INNER JOIN temptable ON answers.call_id = temptable.call_id
WHERE answers.question=2
GROUP BY B, A
ORDER BY B, A;
Explaining in english:
I have tow tables (common index call_id) with a list of surveys in the call_id table and a list of answers in the answers table.
I want to know conditional responses to one question, based on another?
Any help/guidance would be most appreciated.
CREATE TEMPORARY TABLE temp_table
SELECT call_info.call_id, answers.answer
FROM answers INNER JOIN call_info ON answers.call_id = call_info.call_id
WHERE answers.question=1;
SELECT COUNT(temp_table.call_id) as cid, temptable.answer as A, answers.answer as B
FROM answers INNER JOIN temptable ON answers.call_id = temptable.call_id
WHERE answers.question=2
GROUP BY B, A
ORDER BY B, A;
Explaining in english:
I have tow tables (common index call_id) with a list of surveys in the call_id table and a list of answers in the answers table.
I want to know conditional responses to one question, based on another?
Any help/guidance would be most appreciated.