ITPub博客

首页 > Linux操作系统 > Linux操作系统 > 【分享】格式化搜索例子-根据首选供应商选择物料

【分享】格式化搜索例子-根据首选供应商选择物料

原创 Linux操作系统 作者:sapwh 时间:2010-12-03 16:56:04 0 删除 编辑
Select t0.itemcode as 物料编码,t0.itemname as 物料名称,t0.codebars as 旧编码,t0.onhand as 库存量,t1.price as 采购价格 ,t2.price as 销售价格,(case when  isnull(t2.price,0)=0 then 0 when isnull(t2.price,0)<>0 then (isnull(t2.price,0)-isnull(t1.price,0))/isnull(t2.price,0) end) as 毛利率 from  oitm t0 left join (SELECT T0.[ItemCode], T1.[Price] FROM [dbo].[OITM]  T0 INNER JOIN AIT1 T1 ON T0.ItemCode = T1.ItemCode WHERE T1.[PriceList] ='1' and t1.loginstanc= (SELECT max(t0.loginstanc) FROM AIT1 T0 where t0.itemcode=t1.itemcode)) t1 on t0.itemcode=t1.itemcode left join (SELECT T0.[ItemCode], T1.[Price]  FROM [dbo].[OITM]  T0 INNER JOIN AIT1 T1 ON T0.ItemCode = T1.ItemCode WHERE T1.[PriceList] ='2' and t1.loginstanc= (SELECT max(t0.loginstanc) FROM AIT1 T0 where t0.itemcode=t1.itemcode)) t2 on t0.itemcode=t2.itemcode where t0.cardcode=$[OPOR.CARDCODE]

来自 “ ITPUB博客 ” ,链接:https://blog.itpub.net/23503339/viewspace-680893/ ,如需转载,请注明出处,否则将追究法律责任。

下一篇: 【转贴】ERP与SAP
请登录后发表评论 登录
全部评论

注册时间:2010-09-26

  • 博文量
    48
  • 访问量
    66181