Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我必须从表中选择在过去两个小时内添加的行,或者我将在当前日期指定的任何小时数。
我正在做这样的查询,
SELECT * FROM abc WHERE timestamp < '2:00:00' LIMIT 1000;
但它没有返回任何行?我可以在哪里找到此类查询的任何参考资料?
SELECT * FROM abc WHERE timestamp between now() - interval 2 hour and now() LIMIT 1000;
SQLFiddle 示例