1,select count(*) as count,month(addtime) as 月份 from TB group
by month(addtime).
如果只有2,3月份的話,提出啦的數(shù)據(jù)時這樣的
count?? 月份
100??????? 2
400????? 3
?
我想要的結果是這樣的:
count?? 月份
0?????????? 1
100??????? 2
400????? 3
0????????? 4
?
0????????? 5,
...............?? 就是沒有的月份就補0,但是12個月都要出來,要12條數(shù)據(jù),從1,12排
sql統(tǒng)計月的數(shù)量,我的需求是這樣的
慕無忌1623718
2018-12-07 11:39:01