【发布时间】:2012-01-06 21:24:07
【问题描述】:
请帮帮我:
我在 mysql 表中有两列 - date1 (datetime) 和 date2 (datetime)
我需要找到这两天之间的差异大于 14 天的行。
我试过:select * from table where timediff(date1 - date2) as days > 14
它不起作用
谢谢你
【问题讨论】:
请帮帮我:
我在 mysql 表中有两列 - date1 (datetime) 和 date2 (datetime)
我需要找到这两天之间的差异大于 14 天的行。
我试过:select * from table where timediff(date1 - date2) as days > 14
它不起作用
谢谢你
【问题讨论】:
SELECT *
FROM table
WHERE ABS(DATEDIFF(date1,date2)) > 14;
【讨论】: