日期:2014-05-19  浏览次数:20821 次

数据库中表中元素赋值问题!!!
select   menu_topic,temper_id   from   menuInfo,temper   where   temper_id=menu_id  


update   menuInfo   set   menu_topic   where   menu_topic   in(select   menu_topic,temper_id   from   menuInfo,temper   where   temper_id=menu_id   )

哪错了

------解决方案--------------------
update menuInfo set menu_topic where menu_topic in(select menu_topic from menuInfo,temper where temper_id=menu_id )
------解决方案--------------------
menu_id 是变量?还是SqlCommand中的参数?
如果是变量要改为:
"select menu_topic,temper_id from menuInfo,temper where temper_id = ' " + menu_id + " ' "
如果是SqlCommand中的参数,要改为:
select menu_topic,temper_id from menuInfo,temper where temper_id = @menu_id