首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 数据库 > SQL Server >

更新语句有关问题(大侠们帮小弟我看看)

2012-01-31 
更新语句问题(大侠们帮我看看)updateschdulesetisSelected 0whereisSelectednotin(selectcatalogID 0201

更新语句问题(大侠们帮我看看)
update   schdule   set   isSelected= '0 '   where   isSelected   not   in(select   catalogID= '02010000 ',   catalogID= '02020000 ',   catalogID= '02030000 '   from   schdule   where   userID   =   '0000000 ')

不能执行!我想更新schdule表中catalogID= '02010000 ',   catalogID= '02020000 ',   catalogID= '02030000 '   这三个字段的状态为1,其余为0.(这个表里初始状态都为1的)
T   T大家帮帮忙

[解决办法]
update schdule set isSelected=(case when Charindex( ', '+catalogID+ ', ',
',02010000,02020000,02030000, ')> 0 then '1 ' else '0 ' end)
[解决办法]
update schdule set isSelected= '0 ' from schdule where catalogIDnot in( '02010000 ', '02020000 ', '02030000 ') anduserID = '0000000 '
[解决办法]
update schdule set isSelected= '0 ' where isSelected not in( '02010000 ', '02020000 ', '02030000 ')
[解决办法]
手都快的很,

热点排行
Bad Request.