【发布时间】:2015-12-22 01:45:43
【问题描述】:
我有一个表,想要获取两个时间戳之间的现在(当前时间戳)的记录(如果不为空):
id title start end
1 A 1450718820 1450719000
2 B null null
3 C 1450718820 null
4 D null 1450718000
Example 1: if current timestamp - 1450717990 I need records with ID: 2,4
Example 2: if current timestamp - 1450718830 I need records with ID: 1,2,3
Example 3: if current timestamp - 1450719010 I need records with ID: 2,3
谢谢! start 和 end 是 bigint(20) 字段
【问题讨论】: