我想查询lastmodity字段值大于“2009-07-22 00:15:42”的记录,其中lastmodify字段是datetime类型,
我写了一个sql语句:
select id from time where lastmodify > 2009-07-22 00:15:42
在java中执行该语句时候,会发生异常。
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 '00:15:42' at line 1但是将时间改为2009-07-22,不写后面的小时-分钟-秒后,则正常执行。不知道为什么。我只是想从数据库中找出 在某个时间之后的记录。。