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这个是自己写的处理字符串的函数

  • 相关阅读:
    诚聘Python等课程兼职讲师
    Ogre3d
    OGRE中 场景管理器,场景节点和实体
    第四天:原型模式建造者模式
    第二天:装饰模式及面向对象设计原则4则
    表达式求值:面向对象版本
    第五天:模板方法外观模式观察者模式
    第三天:代理模式工厂方法抽象工厂
    第一天:简单工厂与策略模式
    idea files count
  • 原文地址:https://www.cnblogs.com/wangliansong/p/3517569.html
Copyright © 2011-2022 走看看