对我来说,这看起来像一个postgresql(v9.4)错误,或者这是预期的行为? - created_at 2015-02-06
的广告位于表格中,但未使用<=
运算符
addb=# select max(created_at)::date from ads;
max
------------
2015-02-06
(1 row)
addb=# SELECT created_at::date,
count(*) as num_ads,
'created'::text as "activity"
FROM ads where created_at>='2015-02-04'::date and
created_at<='2015-02-06'::date group by created_at::date;
created_at | num_ads | activity
------------+---------+----------
2015-02-04 | 1153 | created
2015-02-05 | 1230 | created
(2 rows)