sql = "insert into borrow (conferenceid,reason,borrowremark,operator,borrowdate,starttime,endtime,borrower,operatortime) values ("+id+",'"+ keys[0] +"','"+keys[2]+"','"+keys[3]+"','"+keys[4] +"','"+ keys[5]+"','"+keys[6]+"','"+keys[1]+"','"+operatortime+"')"; sql +=" update borrow b set b.conferencenumber = c.conferencenumber,b.conferencename = c.conferencename,b.campusname = c.campusname,b.cenferencecontent = c.cenferencecontent,b.buildingname = c.buildingname,b.conferencetype = c.conferencetype,b.remark = c.remark,b.collegeallot = c.collegeallot,b.floor = c.floor form conference c where '"+id+"' = c.id ";上面代碼出錯:com.microsoft.sqlserver.jdbc.SQLServerException: 'b' 附近有語法錯誤。上面基本就是先存了一些數據,在根據id把一張表的數據更新到另一張表里。數據庫是sql server
sql 表名縮寫 方面有點問題。
想要飛的更高
2015-09-21 17:41:34