Grey Sand

学习与积累

  博客园 :: 首页 :: 新随笔 :: 联系 :: 订阅 :: 管理 ::
存储过程问题:

case q9 when 0 then '+''''+'新單'+''''+'
when 1 then '+''''+'再協商'+''''+' end
as jb

假如我要换成 q9<=100 && q9>=85 的判断怎么改?

方法一: set @strSql = 'select case when (q9<=100 and q9>=85) then '+''''+'A'+''''+' when (q9<=84 and q9>=70) then '+''''+'B'+''''+' when (q9<=69 and q9>=55) then '+''''+'C' +''''+' when (q9<=54 and q9>=40) then '+''''+'D'+''''+' when (q9<40) then '+''''+'E'+''''+' end as jb,* from jdkh'

方法二: case    when q9 between 85 and 100 then '+''''+'新單'+''''+' when 1 then '+''''+'再協商'+''''+'



Trackback: http://tb.blog.csdn.net/TrackBack.aspx?PostId=1694638

posted on 2007-09-25 13:29  leon1005  阅读(542)  评论(0)    收藏  举报