Chinaunix首页 | 论坛 | 博客
  • 博客访问: 104647781
  • 博文数量: 19283
  • 博客积分: 9968
  • 博客等级: 上将
  • 技术积分: 196062
  • 用 户 组: 普通用户
  • 注册时间: 2007-02-07 14:28
文章分类

全部博文(19283)

文章存档

2011年(1)

2009年(125)

2008年(19094)

2007年(63)

分类: DB2/Informix

2008-03-19 20:27:35

       
具有和存储过程异曲同工之妙,就是写的时候稍微复杂了些,但是比写个存储过程要省事的多啦。
它的边界值的设置比存储过程要省事的多。
哈哈^_^
 SELECT
                        SOA_GET_NENAME(NE_ID,NE_TYPE) VIRCOLUMN_0,
                        FIRST_RESULT VIRCOLUMN_1,
                        G42             VIRCOLUMN_2,
                        CASE
                        WHEN (G42 >= 93 )
                                THEN   5
                        WHEN (G42 >= 88 )
                                THEN   3 + (G42 - 88)*0.4
                        WHEN (G42 <= 78 )
                                THEN   0
                        WHEN (G42 <= 88  )
                                THEN   3 + (G42 - 88)*0.3
                        ELSE 0
                        END ,
                        G66             VIRCOLUMN_23,
                        case
                        WHEN (G66 >= 130 )
                                THEN   5
                        WHEN (G66 >= 100 )
                                THEN   3 + (G66 - 100)*0.4/6
                        WHEN (G66 <= 40 )
                                THEN  0
                        WHEN (G66 <= 100  )
                                THEN   3 + (G66 - 100)*0.3/6
                        ELSE 0
                        END
                        FROM  CHK_GRADE_FACTHOUR
                        WHERE  (  (chk_grade_facthour.COMPRESS_DATE = '2006-02-14') ) AND (chk_grade
_facthour.NE_TYPE IN (10000,10003) AND chk_grade_facthour.NE_ID IN (-1744891292,1948613501,867223656
,-402456014,-1128953347,91461549,414603468,-1458085134,-578147474,1478501655,202839087,-75534827)) a
nd  (1=1)
                        ORDER BY 1,2 
 
阅读(1676) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~