1
得到總數count()組不知道我是否通過發佈延續問題作爲新問題來破壞社區指南。如果是這樣。對不起!!通過
現在,使用,
SELECT count(alertid) as cnt,date(alertdate) as alertDate
FROM alertmaster a,subscriptionmaster s
WHERE alertDate BETWEEN DATE_SUB(CURDATE(),INTERVAL 7 DAY) AND CURDATE()
GROUP BY date(alertDate),s.subId
ORDER BY a.alertDate DESC;
生產:
13, '2011-04-08'
13, '2011-04-08'
13,「2011-04-08 「
14, '2011-04-07'
13, '2011-04-07'
,我想的是:
39, '2011-04-08'
27, '2011-04-07'
如何實現這一目標?
thnx很多。 luking在我以前的兩個問題..他們的答案..似乎我需要在SQL查詢.. – MalTec 2011-04-08 22:16:27
你似乎也錯過了'JOIN'條件,我認爲。 2張桌子應該如何關聯? – 2011-04-08 22:17:37
哦,是的..編輯時,我想我刪除了錯誤的部分.. thnx爲drwng我的注意力 – MalTec 2011-04-08 22:19:00