Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/ruby-on-rails/60.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Mysql 按特定日期列出的postgres查询记录_Mysql_Ruby On Rails_Ruby_Postgresql - Fatal编程技术网

Mysql 按特定日期列出的postgres查询记录

Mysql 按特定日期列出的postgres查询记录,mysql,ruby-on-rails,ruby,postgresql,Mysql,Ruby On Rails,Ruby,Postgresql,正在使用postgres 我得到了如下类似的专栏 start_time: "2013-11-30 03:51:00" 但我有ruby生成的日期 Date.today -> Mon, 16 Dec 2013 如何触发当天的记录 select * from records where start_time = ? Record.where("start_time = ?", Date.today) 比较一下日期怎么样 Record.where("start_time >= ? a

正在使用postgres

我得到了如下类似的专栏

start_time: "2013-11-30 03:51:00"
但我有ruby生成的日期

Date.today ->  Mon, 16 Dec 2013
如何触发当天的记录

select * from records where start_time = ?
Record.where("start_time = ?", Date.today)

比较一下日期怎么样

Record.where("start_time >= ? and start_time < ?", Date.today, Date.today + 1)
Date.today+1是第二天的开始