Mysql 按特定日期列出的postgres查询记录
正在使用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
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是第二天的开始