回答されていない質問に基づいて、合計数と新しい数を取得しようとしています。
次のような 2 つの SQL 呼び出しがあります。
// retrieves all ids of questions and the timestamps when recorded
SELECT id, timestamp FROM `profile_questions` q WHERE q.user_id=5
// output:
id timestamp
-- ---------
1 1374677344
2 1374677514
// retrieves all answered questions
SELECT a.timestamp
FROM `profile_answers` a
LEFT JOIN profile_questions q ON q.id = a.question_id
WHERE a.answered_by=5
2 つのステートメントを組み合わせて、合計質問数と新しい質問数を返す方法はありますか? 基本的に、回答されていない質問の数ですか?