0
我試圖根據未回答的問題獲得總計數和新計數。mysql基於時間戳計數?
我有兩個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
有沒有辦法給兩個語句結合返回的總問題的計數和對新問題的計數?基本上沒有答案的任何問題的計數?
,做的伎倆...謝謝! – Paul