zoukankan      html  css  js  c++  java
  • 自己写的第一个视图(为了纪念)

    自己写的第一个视图:

    CREATE VIEW [dbo].[view_Returndate]

    AS

    SELECT     p.htid + ',' + p.inspectingitemAssignment AS htidassign, p.htid AS htid, c.classificationname AS classificationname, item.projectnumber AS result,

                          p.phone AS sampleid, p.times AS statu, p.client AS conversion, p.sampledate AS finishtime, item.projectnumber AS projectnumber,c.classification as classification

    FROM         inspectingitem AS item, childinspecting AS c, inspectionpact AS p

    WHERE     item.projectnumber IN

                              (SELECT     *

                                FROM          dbo.f_splitstr(cast(p.inspectingitem AS varchar(1024)), ',')) AND item.projectnumber = c.projectnumber AND

                        (p.htid + '' + item.projectnumber+''+c.classification NOT IN

                              (SELECT     r.htid + '' + r.inspectingitem +''+r.classification AS a

                                FROM          returndate AS r))

    UNION

    SELECT     r.htid + ',' + item.projectnumber AS htidassign, r.htid, c.classificationname AS classificationname, r.result AS result, r.sampleid AS sampleid,

                          r.statu AS statu, r.conversion AS conversion, r.finishtime AS finishtime, r.inspectingitem AS projectnumber,c.classification as classification

    FROM         returndate r LEFT JOIN

                          inspectingitem item ON r.inspectingitem = item.projectnumber LEFT JOIN

                          childinspecting c ON r.inspectingitem = c.projectnumber and r.classification=c.classification

     

     

    // dbo.f_splitstr这个是自己写的处理字符串的函数

  • 相关阅读:
    AD 485、422电路
    AD 差分
    思维导图
    68 二叉树的最近公共祖先
    65. 不用加减乘除做加法
    64. 求1+2+…+n
    10- I. 斐波那契数列
    11&12. 旋转数组的最小数字
    12. 矩阵中的路径
    13. 机器人的运动范围
  • 原文地址:https://www.cnblogs.com/wangliansong/p/3517569.html
Copyright © 2011-2022 走看看