问一个,按日期统计点击数的问题...
select * from ad_hits where ad_id = '131' and year(hits_date) = '2006' and
month(hits_date) = '6' order by hits_date
======================================================
用上面的搜索语句,得到下面的结果..
131 2006-06-01 00:00:00 1
131 2006-06-02 00:00:00 2
131 2006-06-03 00:00:00 1
131 2006-06-05 00:00:00 2
131 2006-06-06 00:00:00 5
131 2006-06-07 00:00:00 1
131 2006-06-10 00:00:00 1
131 2006-06-14 00:00:00 2
==================================
我想得到这样的结果..
131 2006-06-01 00:00:00 1
131 2006-06-02 00:00:00 2
131 2006-06-03 00:00:00 1
131 2006-06-04 00:00:00 0
131 2006-06-05 00:00:00 2
131 2006-06-06 00:00:00 5
131 2006-06-07 00:00:00 1
131 2006-06-08 00:00:00 0
131 2006-06-09 00:00:00 0
131 2006-06-10 00:00:00 1
131 2006-06-11 00:00:00 0
131 2006-06-12 00:00:00 0
131 2006-06-13 00:00:00 0
131 2006-06-14 00:00:00 2
就是,如果当天的点击数为O则自动列出为0记录...