如何 select Timestamp date > or < other Timestamps 的所有记录?
How to select all records where Timestamp date > or < other Timestamps?
比较
Timestamp pubDate = rs.getTimestamp("pubDate");
通过此查询 table 中的所有其他时间戳:
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
正确的语法是什么?
用于从 table 检索行的 SQL 语法是 select
,而不是 get
:
SLEECT * FROM items WHERE pubDate < ?
比较
Timestamp pubDate = rs.getTimestamp("pubDate");
通过此查询 table 中的所有其他时间戳:
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
正确的语法是什么?
用于从 table 检索行的 SQL 语法是 select
,而不是 get
:
SLEECT * FROM items WHERE pubDate < ?