关闭

得到所有信息,减少创建临时表所需时间

286人阅读 评论(0) 收藏 举报
 select a.BillNo,a.ShopInCode,a.ShopInSort,a.ShopOutCode,a.ShopOutSort,a.RedeployType,a.TheDate,a.ConfirmDate,
a.SrcBillSort,a.DeptCode,a.VerifyCode,a.ConsignerCode,a.OperaterCode,a.Remark,a.VerifyRemark,
a.TheState,a.Creater,a.CreateTime,a.UseState,b.theName RedeployTypeName ,c.TheName ShopInName ,d.TheName ShopOutName ,
e.SrcBillNo,e.ProductCode,e.ProductSortCode,e.Number,e.OrderNumber,e.CurrNumber,e.CostPrice,e.RedeployCost,e.RedeployPrice,e.RedeployMoney,e.RedeployInStorage,e.RedeployInPlace,e.RedeployOutStorage,
e.RedeployOutPlace,e.IsListNo,f.TheName ProductName,f.ConfigName,f.UnitName,g.theName StorageInName,h.theName StorageOutName,
i.StorPlaceName RedeployInPlaceName,j.StorPlaceName RedeployOutPlaceName,
f.BrandCode BrandCode,q.TheName BrandName,f.ModelCode ModelCode,r.TheName ModelName,
l.TheName ConsignerName,m.TheName OperaterName,n.TheName VerifyName,o.TheName DeptName,p.TheName CreaterName
from tbStorRedeploy a
Left outer join vStorRedeployType b on a.RedeployType=b.theCode
left outer join tbDatumShop c on a.ShopInCode = c.TheCode
left outer join tbDatumShop d on a.ShopOutCode = d.TheCode
left outer join tbStorRedeployItem e on a.BillNo=e.BillNo
left outer join vDatumProduct   f on e.ProductCode=f.TheCode and e.ProductSortCode=f.ProductSort
left outer join tbDatumStorage      g on e.RedeployInStorage=g.theCode
left outer join tbDatumStorage      h on e.RedeployOutStorage=h.theCode
left outer join tbDatumStorageItem  i on e.RedeployInPlace=i.StorPlaceCode and i.StorageCode=e.RedeployInStorage
left outer join tbDatumStorageItem  j on e.RedeployOutPlace=j.StorPlaceCode and j.StorageCode=e.RedeployOutStorage
left outer join vDatumEmployee l on a.ConsignerCode=l.TheCode
left outer join vDatumEmployee m on a.OperaterCode=m.TheCode
left outer join vDatumEmployee n on a.VerifyCode=n.TheCode
left outer join vDatumEmployee p on a.Creater=p.TheCode
left outer join vDatumDept o on a.DeptCode=o.TheCode
left outer join tbDatumProductBrand q on f.BrandCode=q.TheCode
left outer join tbDatumProductModel r on f.ModelCode=r.TheCode
where (a.ShopInCode in {{ShopGroup}} or a.ShopOutCode in {{ShopGroup}}) and
(e.RedeployInStorage in {{StorageGroup}} or e.RedeployOutStorage in {{StorageGroup}}) {0}
0
0

查看评论
* 以上用户言论只代表其个人观点,不代表CSDN网站的观点或立场
    个人资料
    • 访问:474899次
    • 积分:6326
    • 等级:
    • 排名:第4019名
    • 原创:154篇
    • 转载:178篇
    • 译文:0篇
    • 评论:91条
    文章分类
    最新评论