如何选择时间戳日期>的所有记录或者<其他时间戳?

时间:2015-05-05 17:46:07

标签: mysql sql syntax-error

比较
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

什么是正确的语法?

1 个答案:

答案 0 :(得分:0)

用于从表中检索行的SQL语法是select,而不是get

SLEECT * FROM items WHERE pubDate < ?