SQL 提示缺失右括号
updatet_card_in_cabin_infotcicisetcard_num=((selectcard_numfromt_card_in_cabin_info,t...
update t_card_in_cabin_info tcici
set card_num = ((select card_num
from t_card_in_cabin_info ,t_libr_info
where cabin_id=1 and libr_id=1 and card_type=1)+100)
where cabin_id=1 and card_type=1
总是提示缺失右括号!请高手指教 展开
set card_num = ((select card_num
from t_card_in_cabin_info ,t_libr_info
where cabin_id=1 and libr_id=1 and card_type=1)+100)
where cabin_id=1 and card_type=1
总是提示缺失右括号!请高手指教 展开
2个回答
展开全部
update t_card_in_cabin_info tcici
set card_num = (select card_num +100
from t_card_in_cabin_info ,t_libr_info
where cabin_id=1 and libr_id=1 and card_type=1)
where cabin_id=1 and card_type=1
试试看
set card_num = (select card_num +100
from t_card_in_cabin_info ,t_libr_info
where cabin_id=1 and libr_id=1 and card_type=1)
where cabin_id=1 and card_type=1
试试看
追问
这样运算后的结果是将原来的card_num 值加100后更新吗?(SQL初学者,请见谅~~~)
本回答被提问者采纳
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
展开全部
update的表名别名去掉 后面子查询 又没用到
update t_card_in_cabin_info
set card_num = (select card_num
from t_card_in_cabin_info ,t_libr_info
where cabin_id=1 and libr_id=1 and card_type=1)+100
where cabin_id=1 and card_type=1
sql2005下通过语法检查
update t_card_in_cabin_info
set card_num = (select card_num
from t_card_in_cabin_info ,t_libr_info
where cabin_id=1 and libr_id=1 and card_type=1)+100
where cabin_id=1 and card_type=1
sql2005下通过语法检查
追问
按你的方法操作了,但去掉select最外面的括号和去掉别名后,报错说SQL命令未正确结束。
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询