收到错误消息 [Err] 1060 - Duplicate column name 'id'
SELECT c.id, c.name, COUNT(all.id) 'All',
COUNT(unanswered.id) 'Unanswered',
COUNT(unchecked.id) 'Unchecked'
FROM courses c
INNER JOIN courses-lessons cl ON c.id = cl.cid
INNER JOIN questions all ON cl.id = all.lid
INNER JOIN
(
SELECT *
FROM questions
WHERE id NOT IN (SELECT qid FROM answers)
) unanswered ON cl.id = unchecked.lid
INNER JOIN
(
SELECT *
FROM questions q
INNER JOIN
(
SELECT *
FROM answers
WHERE id NOT IN (SELECT aid FROM answer_chk_results)
) a ON q.id = a.qid
) unchecked ON cl.id = unchecked.lid
GROUP BY c.id, c.name
我错过了什么?找不到问题所在。
更新
数据库结构
https://docs.google.com/open?id=0B9ExyO6ktYcOenZ1WlBwdlY2R3c