sql 表名缩写 方面有点问题。

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

想要飞的更高
浏览 4243回答 1
1回答

习惯受伤

update的时候不能对表名缩写,update的语句格式为:update table set col1=value[,col2=value2] [where ...]
打开App,查看更多内容
随时随地看视频慕课网APP