jsp中sql语句为什么从where或者是从from处换行后不执行,代码如下sql1错误,sql2正确。
sql1="selectGCData.deviceId,GCData.time,GCData.latitude,GCData.longitude,bindingTable...
sql1="select GCData.deviceId,GCData.time,GCData.latitude,GCData.longitude,bindingTable.trainId,bindingTable.containerId,"+
"bindingTable.containerType,bindingTable.routeType from GCData,bindingTable"+
"where GCData.deviceId=bindingTable.IMEI and GCData.deviceId="+"'"+id[i]+"'"+"and bindingTable.state='Y' and GCData.time>="+"'"+startTime+"'"+"and GCData.time<="+"'"+endTime+"'";
sql2="select GCData.deviceId,GCData.time,GCData.latitude,GCData.longitude,bindingTable.trainId,bindingTable.containerId,"+
"bindingTable.containerType,bindingTable.routeType from GCData,bindingTable where GCData.deviceId=bindingTable.IMEI and GCData.deviceId="+"'"+id[i]+"'"+"and bindingTable.state='Y' and GCData.time>="+"'"+startTime+"'"+"and GCData.time<="+"'"+endTime+"'";
adt.getGCResults(sql,ID,GCTime,alat,alon,trainId,containerId,containerType,routeType); 展开
"bindingTable.containerType,bindingTable.routeType from GCData,bindingTable"+
"where GCData.deviceId=bindingTable.IMEI and GCData.deviceId="+"'"+id[i]+"'"+"and bindingTable.state='Y' and GCData.time>="+"'"+startTime+"'"+"and GCData.time<="+"'"+endTime+"'";
sql2="select GCData.deviceId,GCData.time,GCData.latitude,GCData.longitude,bindingTable.trainId,bindingTable.containerId,"+
"bindingTable.containerType,bindingTable.routeType from GCData,bindingTable where GCData.deviceId=bindingTable.IMEI and GCData.deviceId="+"'"+id[i]+"'"+"and bindingTable.state='Y' and GCData.time>="+"'"+startTime+"'"+"and GCData.time<="+"'"+endTime+"'";
adt.getGCResults(sql,ID,GCTime,alat,alon,trainId,containerId,containerType,routeType); 展开
1个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询