• 一个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
  • 相关阅读:
    hdoj2159【二位费用背包】
    POJ2367【拓扑排序】
    POJ2371【水题】
    POJ2369【循环节】
    POJ2370【水题】
    POJ2365【几何】
    POJ2366【二分】
    POJ1276【多重背包】
    瞎说一波3种基本背包问题【希望巨巨们指出错误】
    Codeforces 550B 【暴力】
  • 原文地址:https://www.cnblogs.com/ljjphysics/p/2104709.html
Copyright © 2020-2023  润新知