我正在尝试过滤我的查询数据,只返回"Meeting Start"
大于CURRENT_TIMESTAMP
但 的项目不迟于12小时CURRENT_TIMESTAMP。
我可以在查询中下面的CURRENT_TIMESTAMP中添加12小时吗?
当前工作查询:
$query ="SELECT * FROM Reservations WHERE [Room_ID] = '$field' AND [Meeting Start] > CURRENT_TIMESTAMP ORDER BY [Meeting Start] asc ";
更新了尝试:
$query ="SELECT * FROM Reservations WHERE [Room_ID] = '$field' AND [Meeting Start] > CURRENT_TIMESTAMP AND [Meeting Start] < (CURRENT_TIMESTAMP + 12) ORDER BY [Meeting Start] asc ";
答案 0 :(得分:35)
NOW() + INTERVAL 12 HOUR
应该做到这一点。 +12
含糊不清。 12秒?分钟?天?年?