使用Coldfuson& MySQL - 如何更新查询以检查具有过去24小时内发生的时间戳的新条目?
查询:
<cfquery name="caller.sel_BlogEntries" datasource="#request.db#">
SELECT blogentry.dateAdded, person.personName
FROM blogentry INNER JOIN person ON blogentry.personID = person.personID
WHERE blogentry.deleted = 'N'
ORDER BY blogentry.dateAdded DESC
</cfquery>
blogentry.dateAdded是一个MySql TimeStamp
由于
答案 0 :(得分:3)
WHERE ...
AND DATE_ADD(blogentry.dateAdded, INTERVAL 1 DAY) >= NOW()