这是我的尝试:
rs = statement.executeQuery("select * from geninfo where DeviceTag='" + deviceTag + "' and timestamp='date('"+fromYear + "-" +fromMonth + "-" + fromDay + "')';");
它看起来类似于:
select * from geninfo where timestamp='date('2013-07-08')';
错误是(near "2013": syntax error)
存储的值为“2013-07-08 09:08:51”
我想选择某一天的所有数据。另外,将另一列存储为日期对象会更容易吗?