[英]Selecting records from MYSQL table that were created in the last 24 hours via TIMESTAMP type
[英]MySQL, Coldfusion, Selecting records that were timestamped in the last 24 hours
使用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
謝謝
WHERE ...
AND DATE_ADD(blogentry.dateAdded, INTERVAL 1 DAY) >= NOW()
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.