码迷,mamicode.com
首页 > 数据库 > 详细

DB2数据库用 With语句分隔字符

时间:2015-01-08 21:35:18      阅读:279      评论:0      收藏:0      [点我收藏+]

标签:

SELECT T1.REPAIRNO,
       T1.UNDERTAKER10,
       T3.FULLNAME          AS RECEIVERNAME,
       T1.WALKDISTANCE,
       T1.STATUSCODEDATE10  AS RECEIVETIME,
       t8.REPAIRTYPE,
       T5.DELIVEREDDATE,
       CASE 
            WHEN T2.REPAIRNO IS NULL THEN 
            ELSE 
       END                     ISINSURANCE,
       T2.FIXEDDATE,
       T4.FULLNAME          AS CLAIMSNNAME,
       T2.TotalFee
FROM   RT_REPAIR T1
       LEFT JOIN RT_INSURANCECLAIMS T2
            ON  T1.REPAIRNO = T2.REPAIRNO
            AND T1.FRAMENO = T2.FRAMENO
       LEFT JOIN CM_STAFF T3
            ON  T1.UNDERTAKER10 = T3.STAFFPKID
       LEFT JOIN CM_STAFF T4
            ON  T2.ClaimsID = T4.STAFFPKID
       LEFT JOIN RT_REPAIRPROCESS T5
            ON  T1.REPAIRNO = T5.REPAIRNO
       LEFT JOIN RT_CUSTOMERWISH T6
            ON  T1.REPAIRNO = T6.REPAIRNO
       LEFT JOIN RT_WORKCONTENT T7
            ON  T6.REPAIRNO = T7.REPAIRNO
            AND T6.WISHID = T7.WISHID
       LEFT JOIN RM_RepairType t8
            ON  t7.RepairTypeCode = t8.repairtypecode
WHERE  T1.FRAMENO = LHGRB186982000004
       AND STATUSCODE = 99
ORDER BY
       REPAIRNO                DESC   

 

DB2数据库用 With语句分隔字符

标签:

原文地址:http://www.cnblogs.com/ShaYeBlog/p/4211813.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!