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
  • 相关阅读:
    day15—jQuery UI之widgets插件
    day14—jQuery UI 之dialog部件
    day13—CSS之导航栏
    day12—jQuery ui引入及初体验
    day11—前端学习之我不想看书
    struts2的action方法匹配以及通配符的使用
    Java中的static
    ActiveMQ的简单使用
    MS DOS 常用命令整理
    IntelliJ IDEA 中 Ctrl+Alt+Left/Right 失效
  • 原文地址:https://www.cnblogs.com/ljjphysics/p/2104709.html
Copyright © 2011-2022 走看看