sql4 = "select sum(aid_amount) from t_grant_city";
sql4 +="where apply_id like '"+((String)unitids.elementAt(i)).substring(0,6)+"%' ";
sql4 +="and substr(pay_date,0,7) >= '"+s_date2+"' and substr(pay_date,0,7) <= '"+s_date+"'";rs4=stmt3.executeQuery(sql4);后
说SQL没有准确结束。请帮帮忙 sql3能执行
sql3 ="select sum(aid_amount) from t_grant_city ";
sql3 +="where apply_id like '"+((String)unitids.elementAt(i)).substring(0,6)+"%' and substr(pay_date,0,7)='"+s_date+"'";
sql4 +="where apply_id like '"+((String)unitids.elementAt(i)).substring(0,6)+"%' ";
sql4 +="and substr(pay_date,0,7) >= '"+s_date2+"' and substr(pay_date,0,7) <= '"+s_date+"'";rs4=stmt3.executeQuery(sql4);后
说SQL没有准确结束。请帮帮忙 sql3能执行
sql3 ="select sum(aid_amount) from t_grant_city ";
sql3 +="where apply_id like '"+((String)unitids.elementAt(i)).substring(0,6)+"%' and substr(pay_date,0,7)='"+s_date+"'";
sql4 = "select sum(aid_amount) from t_grant_city ";
强,你是在少了个空格,把t_grant_city与where 粘在一起了