asp+sql server中update的问题

2024-11-23 12:41:52
推荐回答(2个)
回答1:

sql语句这么改:
update workxx set jiaci=w.jiaci-1 from workxx w inner join
qingjia q on q.id=w.id where q.qid=...

在update之前,你先执行以下select 语句好不好使.select 不好使,说明语法有错误。
你的语句改成select 语句:
select jiaci from workxx where workxx.id=qingjia.id and qingjia.id=(select qingjia.id from qingjia where qingjia.qid=‘值’)

回答2:

嗯,1楼是正确的:
exec="update workxx set jiaci=jiaci-1 from workxx w inner join
qingjia q on q.id=w.id where q.qid ='"+request.form("qid")+"')"