zoukankan      html  css  js  c++  java
  • 一个SQL语句

    select a.GoodsName,'采购收货',a.BillCode,a.Price,a.RNumber,a.RMoney,a.Pccode,b.AddDate,b.CustName from (SELECT * FROM T_DepotGoodsInDetail WHERE GoodsName='涤丝类') AS a JOIN (SELECT * FROM T_DepotGoodsIn WHERE AddDate>='2007-01-01' and AddDate<='2009-01-01' AND Custname ='杭州金典布业有限公司') AS b ON a.BillCode = b.Billcode

    UNION

    select a.GoodsName,'销售出货',a.BillCode,a.Price,a.RNumber,a.RMoney,a.Pccode,b.AddDate,b.CustName from (SELECT * FROM T_DepotGoodsOutDetail WHERE GoodsName='涤丝类') AS a JOIN (SELECT * FROM T_DepotGoodsOut WHERE AddDate>='2007-01-01' and AddDate<='2009-01-01' AND Custname ='杭州金典布业有限公司') AS b ON a.BillCode = b.Billcode

    UNION

    select a.GoodsName,'产品入库',a.BillCode,a.Price,a.RNumber,a.RMoney,a.Pccode,b.AddDate,b.CustName from (SELECT * FROM T_DepotDyeInDetail WHERE GoodsName='涤丝类') AS a JOIN (SELECT * FROM T_DepotDyeIn WHERE AddDate>='2007-01-01' and AddDate<='2009-01-01' AND Custname ='杭州金典布业有限公司') AS b ON a.BillCode = b.Billcode

    UNION
    select a.GoodsName,'领用出库',a.BillCode,a.Price,a.RNumber,a.RMoney,a.Pccode,b.AddDate,b.CustName from (SELECT * FROM T_DepotDyeOutDetail WHERE GoodsName='涤丝类') AS a JOIN (SELECT * FROM T_DepotDyeOut WHERE AddDate>='2007-01-01' and AddDate<='2009-01-01' AND Custname ='杭州金典布业有限公司') AS b ON a.BillCode = b.Billcode

    ORDER BY b.AddDate
  • 相关阅读:
    unix网络编程源码编译问题
    ubuntu15.04下安装docker
    hexo博客的相关配置
    hexo的jacman主题配置
    使用github和hexo搭建静态博客
    操作系统简单认识
    github for windows安装以及教程
    编译原理第五单元习题
    python3入门之列表和元组
    Python3入门之软件安装
  • 原文地址:https://www.cnblogs.com/ljjphysics/p/2104709.html
Copyright © 2011-2022 走看看