0
我在數據庫(源碼)表中顯示爲 「0」 .The表有兩列:如何,當我在SQL查詢中使用GROUP BY
samochod_id samochod_data_dodania
1 2012-11-13
2 2012-12-18
3 2012-12-21
4 2013-01-03
5 2013-02-16
6 2013-02-27
7 2013-04-03
我使用的查詢:
select strftime('%Y',samochod_data_dodania) as year,
strftime('%m',samochod_data_dodania) as month,
count() ile
from samochod
where samochod_data_dodania between '2012-09-11' and '2013-05-26'
group by year,month
結果:
year month ile
2012 11 1
2012 12 2
2013 01 1
2013 02 2
2013 04 1
我想:
year month ile
2012 09 0
2012 10 0
2012 11 1
2012 12 2
2013 01 1
2013 02 2
2013 03 0
2013 04 1
2013 05 0
怎麼辦呢?請幫助:)