Postgresql 从php中的查询结果获取数组中的日期

Postgresql 从php中的查询结果获取数组中的日期,postgresql,laravel-5,Postgresql,Laravel 5,我使用postgresql和laravel 5.3得到了如下查询结果 from_date to_date 26/12/2017 28/12/2017 27/12/2017 31/12/2017 我需要获得2017年12月26日至2017年12月31日之间的所有日期 请帮助基于laravel-5标记,我建议使用laravel查询生成器,它支持以下操作: DB::table('tbl_name')->select('*')->whereDate('fro

我使用postgresql和laravel 5.3得到了如下查询结果

from_date       to_date
26/12/2017      28/12/2017
27/12/2017      31/12/2017
我需要获得2017年12月26日至2017年12月31日之间的所有日期


请帮助

基于laravel-5标记,我建议使用laravel查询生成器,它支持以下操作:

DB::table('tbl_name')->select('*')->whereDate('from_date','>=','2017-12-26')->whereDate('to_date','<=','2017-12-31')->get();

DB::table('tbl_name')->select('*')->whereDate('from_date','>=','2017-12-26')->whereDate('to_date','根据两条记录的有限结果集,您已经在执行此操作了。请向我们显示源数据和您的查询。使用的查询:select from_date,to_date from“tbl_name”where“to_date”>='2017-12-28'您希望所有记录的“to”和“from”日期完全在范围内,还是其他什么?是的,完全正确..我希望所有从“from date”到“to date”的日期都在一个数组中您希望所有记录都在2017年12月26日到2017年12月31日之间吗?
select * from "tbl_name" where "to_date" <= '2017-12-26' AND "from_date" >= '2017-12-31'