原来pg生成日期序列这么容易,我在sql server里只能写递归来完成,囧
select generate_series from generate_series(to_date('2012-04-19','yyyy-mm-dd'),
to_date('2012-05-18', 'yyyy-mm-dd'),
'1 day' ::interval)
select generate_series from generate_series(to_date('2012-04-19','yyyy-mm-dd'),
to_date('2012-05-18', 'yyyy-mm-dd'),
'1 day' ::interval)
![](http://images0.cnblogs.com/blog/8562/201304/26102410-63f094fcfd8549819bc33a4d9210d6b2.png)