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
查看完整描述
TA贡献885条经验 获得超1144个赞
update的时候不能对表名缩写,update的语句格式为:update table set col1=value[,col2=value2] [where ...]
查看完整回答
2017-01-09