MySQL,Coldfusion,选择过去24小时内加上时间戳的记录

时间:2010-05-09 02:55:01

标签: mysql datetime coldfusion

使用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

由于

1 个答案:

答案 0 :(得分:3)

WHERE ... 
  AND DATE_ADD(blogentry.dateAdded, INTERVAL 1 DAY) >= NOW()