I'm trying to get a total count and a new count based on questions not answered.
I have two SQL calls that looks like so:
// 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
Is there a way to combine the two statements to return a count of total questions and a count for new questions? Basically a count of any questions not answered?