作者热门文章
- android - RelativeLayout 背景可绘制重叠内容
- android - 如何链接 cpufeatures lib 以获取 native android 库?
- java - OnItemClickListener 不起作用,但 OnLongItemClickListener 在自定义 ListView 中起作用
- java - Android 文件转字符串
我有以下查询....
SELECT fixture_date FROM tbl_foot_games WHERE fixture_date < now() AND leagueid = '68' AND (type = '2' OR type = '12' OR type = '22' OR type = '32') GROUP BY fixture_date ORDER BY fixture_date
输出如下....
1318876658 1319135858 1319395058 1319654258 1319913458 1320176258 1320435458 1320694658 1320953858 1321213058 1321472258
所有这些时间戳现在都提前了。知道它为什么输出任何东西吗?
不过,我需要将 now() 更改为 future 3 天。 72 小时!
有什么想法吗?谢谢:)
最佳答案
尝试:
SELECT fixture_date
FROM tbl_foot_games
WHERE FROM_UNIXTIME(fixture_date) < NOW()
AND leagueid = '68'
AND type IN ('2', '12', '22', '32')
GROUP BY fixture_date
ORDER BY fixture_date
但是您真的不应该将时间戳存储为 CHAR
或 VARCHAR
。
关于mysql - SQL WHERE on now() 无法正常工作?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/7772688/
我是一名优秀的程序员,十分优秀!