wbwuvb
发表于 2013-4-15 23:17:10
RE: 汉之殇——全骑凹型阵!!(第一期) [修改]
三国迷糊剑
发表于 2013-4-15 23:55:49
hahahah bxnasnsjsff
2276960970
发表于 2013-4-16 13:20:58
CREATE or REPLACE VIEW scm_rpt_o_0270_vw /*t4品番表(SCM_MTL_MATERIAL_TBL)
t1库存明细单(SCM_WMS_INV_PROC_DTL_TBL)t2库存处理单(SCM_WMS_INV_PROC_TBL)
t3采购订单(SCM_PO_ORDER_TBL)*/
AS
SELECT t4.RETROFIT_TYPE ,t4.DIST_TYPE,
DATE_FORMAT(CONVERT(CONCAT(t1.ACT_RCPT_DATE,'01'),datetime),'%Y') as YYYY,
CASE WHEN mid(t1.ACT_RCPT_DATE,5,2) = '01' THEN (CASE WHEN DATE_SUB(t3.CREATE_DATE,INTERVAL 30
DAY)>=t1.ACT_RCPT_DATE THEN t1.PO_RECONCIL_QTY ELSE NULL END) ELSE NULL END AS
SELL_WITHIN_01,
CASE WHEN mid(t1.ACT_RCPT_DATE,5,2) = '01' THEN (CASE WHEN DATE_SUB(t3.CREATE_DATE,INTERVAL 30
DAY)<t1.ACT_RCPT_DATE THEN t1.PO_RECONCIL_QTY ELSE NULL END) ELSE NULL END AS
SELL_BEYOND_01,
CASE WHEN mid(t1.ACT_RCPT_DATE,5,2) = '02' THEN (CASE WHEN DATE_SUB(t3.CREATE_DATE,INTERVAL 30
DAY)>=t1.ACT_RCPT_DATE THEN t1.PO_RECONCIL_QTY ELSE NULL END) ELSE NULL END AS
SELL_WITHIN_02,
CASE WHEN mid(t1.ACT_RCPT_DATE,5,2) = '02' THEN (CASE WHEN DATE_SUB(t3.CREATE_DATE,INTERVAL 30
DAY)<t1.ACT_RCPT_DATE THEN t1.PO_RECONCIL_QTY ELSE NULL END) ELSE NULL END AS
SELL_BEYOND_02,
CASE WHEN mid(t1.ACT_RCPT_DATE,5,2) = '03' THEN (CASE WHEN DATE_SUB(t3.CREATE_DATE,INTERVAL 30
DAY)>=t1.ACT_RCPT_DATE THEN t1.PO_RECONCIL_QTY ELSE NULL END) ELSE NULL END AS
SELL_WITHIN_03,
CASE WHEN mid(t1.ACT_RCPT_DATE,5,2) = '03' THEN (CASE WHEN DATE_SUB(t3.CREATE_DATE,INTERVAL 30
DAY)<t1.ACT_RCPT_DATE THEN t1.PO_RECONCIL_QTY ELSE NULL END) ELSE NULL END AS
SELL_BEYOND_03,
CASE WHEN mid(t1.ACT_RCPT_DATE,5,2) = '04' THEN (CASE WHEN DATE_SUB(t3.CREATE_DATE,INTERVAL 30
DAY)>=t1.ACT_RCPT_DATE THEN t1.PO_RECONCIL_QTY ELSE NULL END) ELSE NULL END AS
SELL_WITHIN_04,
CASE WHEN mid(t1.ACT_RCPT_DATE,5,2) = '04' THEN (CASE WHEN DATE_SUB(t3.CREATE_DATE,INTERVAL 30
DAY)<t1.ACT_RCPT_DATE THEN t1.PO_RECONCIL_QTY ELSE NULL END) ELSE NULL END AS
SELL_BEYOND_04,
CASE WHEN mid(t1.ACT_RCPT_DATE,5,2) = '05' THEN (CASE WHEN DATE_SUB(t3.CREATE_DATE,INTERVAL 30
DAY)>=t1.ACT_RCPT_DATE THEN t1.PO_RECONCIL_QTY ELSE NULL END) ELSE NULL END AS
SELL_WITHIN_05,
CASE WHEN mid(t1.ACT_RCPT_DATE,5,2) = '05' THEN (CASE WHEN DATE_SUB(t3.CREATE_DATE,INTERVAL 30
DAY)<t1.ACT_RCPT_DATE THEN t1.PO_RECONCIL_QTY ELSE NULL END) ELSE NULL END AS
SELL_BEYOND_05,
CASE WHEN mid(t1.ACT_RCPT_DATE,5,2) = '06' THEN (CASE WHEN DATE_SUB(t3.CREATE_DATE,INTERVAL 30
DAY)>=t1.ACT_RCPT_DATE THEN t1.PO_RECONCIL_QTY ELSE NULL END) ELSE NULL END AS
SELL_WITHIN_06,
CASE WHEN mid(t1.ACT_RCPT_DATE,5,2) = '06' THEN (CASE WHEN DATE_SUB(t3.CREATE_DATE,INTERVAL 30
DAY)<t1.ACT_RCPT_DATE THEN t1.PO_RECONCIL_QTY ELSE NULL END) ELSE NULL END AS
SELL_BEYOND_06,
CASE WHEN mid(t1.ACT_RCPT_DATE,5,2) = '07' THEN (CASE WHEN DATE_SUB(t3.CREATE_DATE,INTERVAL 30
DAY)>=t1.ACT_RCPT_DATE THEN t1.PO_RECONCIL_QTY ELSE NULL END) ELSE NULL END AS
SELL_WITHIN_07,
CASE WHEN mid(t1.ACT_RCPT_DATE,5,2) = '07' THEN (CASE WHEN DATE_SUB(t3.CREATE_DATE,INTERVAL 30
DAY)<t1.ACT_RCPT_DATE THEN t1.PO_RECONCIL_QTY ELSE NULL END) ELSE NULL END AS
SELL_BEYOND_07,
CASE WHEN mid(t1.ACT_RCPT_DATE,5,2) = '08' THEN (CASE WHEN DATE_SUB(t3.CREATE_DATE,INTERVAL 30
DAY)>=t1.ACT_RCPT_DATE THEN t1.PO_RECONCIL_QTY ELSE NULL END) ELSE NULL END AS
SELL_WITHIN_08,
CASE WHEN mid(t1.ACT_RCPT_DATE,5,2) = '08' THEN (CASE WHEN DATE_SUB(t3.CREATE_DATE,INTERVAL 30
DAY)<t1.ACT_RCPT_DATE THEN t1.PO_RECONCIL_QTY ELSE NULL END) ELSE NULL END AS
SELL_BEYOND_08,
CASE WHEN mid(t1.ACT_RCPT_DATE,5,2) = '09' THEN (CASE WHEN DATE_SUB(t3.CREATE_DATE,INTERVAL 30
DAY)>=t1.ACT_RCPT_DATE THEN t1.PO_RECONCIL_QTY ELSE NULL END) ELSE NULL END AS
SELL_WITHIN_09,
CASE WHEN mid(t1.ACT_RCPT_DATE,5,2) = '09' THEN (CASE WHEN DATE_SUB(t3.CREATE_DATE,INTERVAL 30
DAY)<t1.ACT_RCPT_DATE THEN t1.PO_RECONCIL_QTY ELSE NULL END) ELSE NULL END AS
SELL_BEYOND_09,
CASE WHEN mid(t1.ACT_RCPT_DATE,5,2) = '10' THEN (CASE WHEN DATE_SUB(t3.CREATE_DATE,INTERVAL 30
DAY)>=t1.ACT_RCPT_DATE THEN t1.PO_RECONCIL_QTY ELSE NULL END) ELSE NULL END AS
SELL_WITHIN_10,
CASE WHEN mid(t1.ACT_RCPT_DATE,5,2) = '10' THEN (CASE WHEN DATE_SUB(t3.CREATE_DATE,INTERVAL 30
DAY)<t1.ACT_RCPT_DATE THEN t1.PO_RECONCIL_QTY ELSE NULL END) ELSE NULL END AS
SELL_BEYOND_10,
CASE WHEN mid(t1.ACT_RCPT_DATE,5,2) = '11' THEN (CASE WHEN DATE_SUB(t3.CREATE_DATE,INTERVAL 30
DAY)>=t1.ACT_RCPT_DATE THEN t1.PO_RECONCIL_QTY ELSE NULL END) ELSE NULL END AS
SELL_WITHIN_11,
CASE WHEN mid(t1.ACT_RCPT_DATE,5,2) = '11' THEN (CASE WHEN DATE_SUB(t3.CREATE_DATE,INTERVAL 30
DAY)<t1.ACT_RCPT_DATE THEN t1.PO_RECONCIL_QTY ELSE NULL END) ELSE NULL END AS
SELL_BEYOND_11,
CASE WHEN mid(t1.ACT_RCPT_DATE,5,2) = '12' THEN (CASE WHEN DATE_SUB(t3.CREATE_DATE,INTERVAL 30
DAY)>=t1.ACT_RCPT_DATE THEN t1.PO_RECONCIL_QTY ELSE NULL END) ELSE NULL END AS
SELL_WITHIN_12,
CASE WHEN mid(t1.ACT_RCPT_DATE,5,2) = '12' THEN (CASE WHEN DATE_SUB(t3.CREATE_DATE,INTERVAL 30
DAY)<t1.ACT_RCPT_DATE THEN t1.PO_RECONCIL_QTY ELSE NULL END) ELSE NULL END AS
SELL_BEYOND_12,
t1.ID
FROM SCM_WMS_INV_PROC_DTL_TBL t1 INNER JOIN
SCM_WMS_INV_PROC_TBL t2 ON t1.BILL_ID=t2.ID
INNER JOIN SCM_PO_ORDER_TBL t3 ON t1.DATA_SOURCE_ID=t3.ID
INNER JOIN SCM_MTL_MATERIAL_TBL t4 ON t1.ITEM_ID=t4.ID
WHERE t1.DATA_SOURCE_BILL='PO_ORDER'
听雨
发表于 2013-4-16 14:00:29
看看,悄悄
胖宝宝
发表于 2013-4-17 10:10:59
看看再说
zhuzh3u
发表于 2013-4-17 10:23:21
kankan bucuo
醉心醉月
发表于 2013-4-18 08:07:34
。。。。。。。。。。。。。。。。。。。。
俺会好好爱伱地
发表于 2013-4-18 14:54:03
{:soso_e100:}
T`Wicker
发表于 2013-4-20 17:11:52
看一看!!!!!!!!!!!!!!!!!!!!
hehezhuanjia
发表于 2013-4-20 17:15:56
{:soso_e118:},看看看···
吢誶偂①仯の『
发表于 2013-4-20 17:31:54
看看怎么杨
哈哈一一
发表于 2013-4-20 17:48:57
-----------------
天下第一人
发表于 2013-4-20 19:53:18
谢谢分享
小丑鱼
发表于 2013-4-20 19:54:42
鲜花奉上
DENNISCANA
发表于 2013-4-24 23:28:50
cccccccccccccccccccccccccccccc
hezhongfeng
发表于 2013-4-25 13:17:22
支持一下
不错啊
红海豚
发表于 2013-4-26 19:18:04
你用轻骑兵可以吗?卫队比较强看不出什么
叶无道
发表于 2013-4-26 23:04:15
…………………
叶无道
发表于 2013-4-26 23:10:43
………………
哼哼鱼
发表于 2013-4-26 23:31:43
顶顶顶顶顶顶顶顶