比较
Timestamp 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
什么是正确的语法?
答案 0 :(得分:0)
用于从表中检索行的SQL语法是select
,而不是get
:
SLEECT * FROM items WHERE pubDate < ?