首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 网站开发 > asp.net >

存储过程中关于case-when-then 的用法有关问题?

2012-02-01 
存储过程中关于case--when---then 的用法问题????case(kbn)when(1 or 2 or 3 or 4)thenset @falgtrueend

存储过程中关于case--when---then 的用法问题????
case(kbn)
when(1 or 2 or 3 or 4)
then
  set @falg=true
end


这样写条件可以吗?为什么保存时老提示出错阿?????

[解决办法]
你用的是sql 数据库吗 如果是 

case kbn 
when 1 or 2 or 3 or 4 
then 
set @falg=true 
end 

[解决办法]
貌似没有这么用的吧
case子句应该用在其他子句内 不能够这样单独使用。
[解决办法]
Select * case(kbn)..........
[解决办法]
select case( Column ) 
when 1 or 2 or 3 or 4 or 5
then expression
END
FROM TableName

 
[解决办法]
set @falg=true 
这里错了 !不能这样用!!

热点排行