比较
时间戳 pubDate = rs.getTimestamp("pubDate");
与此查询表中的所有其他时间戳:
get * from items where pubDate<?
抛出错误:
com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'get * from items where
pubDate<'2015-05-04 18:26:00'' at line 1
正确的语法是什么?
最佳答案
用于从表中检索行的 SQL 语法是 select
,而不是 get
:
SLEECT * FROM items WHERE pubDate < ?
关于mysql - 如何选择时间戳日期 > 或 < 其他时间戳的所有记录?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/30059821/