Redis 从数据库里查找前一天的新增数据

sjzg001 · December 20, 2013 · Last by lhy20062008 replied at January 26, 2015 · 8291 hits

用一个查询语句找出前一天的新增数据,怎么写?数据库里是把时间的整数。Time.new.to_i 现在 where 该怎么查询

类似这样? between 1.days.ago.to_i and Time.now.to_i

gem 'by_star'

created_at > (前一天00:00:00).to_i and created_at < (前一天23:59:59).to_i

这个是要查询所有的表么?可以将前一天的数据放原数据库的同时放入临时数据库,这样临时数据库的数据都是前一天的,而且可以很方便的批量导出所有数据。

#1 楼 @small_fish__ #3 楼 @ywjno 楼主应该知道这种比较吧

You need to Sign in before reply, if you don't have an account, please Sign up first.