テーブルポストがあります:
Column | Type | Modifiers
-------------------+--------------------------+----------------------------------------------------
body | text | not null
from | character varying(2000) | not null
date | timestamp with time zone | not null
ユーザーが 1 日に何行持っているかを数えたいと思います。特定の月の毎日に 1 行です。
オラクルでは、当月と同じ日数のテーブルを「生成」し、「日付」列を「生成された」日付と結合します。
何かのようなもの
> select *
2 from (select sysdate + level l from dual connect by level < 10)
3 /
L
----------
2013-06-07
2013-06-08
2013-06-09
2013-06-10
2013-06-11
2013-06-12
2013-06-13
2013-06-14
2013-06-15
9 rows selected.
postgresに似たようなものはありますか?