- 打卡等级:无名新人
- 打卡总天数:4
- 打卡月天数:3
- 打卡总奖励:24
- 最近打卡:2024-11-20 10:41:09
|
楼主 |
发表于 2010-3-11 22:32:26
|
显示全部楼层
本帖最后由 chenyilin 于 2010-3-11 22:34 编辑
从2005-2009年的。除了2005其它的都成功了。我看了2006年的表跟2005里的一模一样的
第一次用时间探查器,跟踪出来一些数据。可是也不懂怎么理解:
ALTER VIEW Sales_FHD_W
AS
SELECT TOP 100 PERCENT DispatchLists.AutoID, Warehouse.cWhName, DispatchLists.cFree1, DispatchLists.cFree2, DispatchLists.cWhCode,
DispatchLists.cInvCode, Inventory.bService, Inventory.cInvName, Inventory.cInvStd, Inventory.cInvM_Unit, Inventory.cInvA_Unit, Inventory.cInvAddCode,
(CASE WHEN IsNull(Dispatchlists.iTb, 0) <> 0 THEN DispatchLists.TBNum ELSE DispatchLists.iNum END) AS iNum,
Inventory.iInvExchRate, (CASE WHEN IsNull(Dispatchlists.iTb, 0) <> 0 THEN DispatchLists.TBQuantity ELSE DispatchLists.iQuantity END) AS iQuantity,
DispatchLists.iSettleNum, DispatchLists.iSettleQuantity, DispatchLists.iQuotedPrice, DispatchLists.iTaxUnitPrice, DispatchLists.iUnitPrice, DispatchLists.iMoney,
DispatchLists.iTax, DispatchLists.iDisCount, DispatchLists.cBatch, DispatchLists.DLID, DispatchLists.iCorID, DispatchLists.iNatUnitPrice,
DispatchLists.iNatMoney, DispatchLists.iNatTax, DispatchLists.iNatSum, DispatchLists.iNatDisCount, DispatchLists.iSum, Inventory.iInvLSCost,
DispatchLists.iBatch, DispatchLists.bSettleAll, Inventory.bInvBatch, Warehouse.cWhValueStyle, Inventory.bFree1, Inventory.bFree2,
Inventory.cInvDefine1, Inventory.cInvDefine2, Inventory.cInvDefine3, Inventory.iInvWeight, Inventory.iVolume, DispatchLists.KL, DispatchLists.KL2,
Inventory.bInvType, DispatchLists.iTb, DispatchLists.dVDate, DispatchLists.iTaxRate, DispatchLists.cDefine22, DispatchLists.cDefine23, DispatchLists.cDefine24,
DispatchLists.cDefine25, DispatchLists.cDefine26, DispatchLists.cDefine27, DispatchLists.iSOsID, DispatchLists.iDLsID, DispatchLists.cItemCode,
DispatchLists.cItem_Class, SO_SODetails.cSOCode,100-DispatchLists.KL AS DKL1,100-DispatchLists.KL2 AS DKL2,
DispatchLists.fSaleCost,DispatchLists.fSalePrice,DispatchLists.cVenAbbName,Inventory.cInvCCode,DispatchLists.cItemName,DispatchLists.cItem_CName
FROM SO_SODetails RIGHT JOIN DispatchLists ON SO_SODetails.iSOsID = DispatchLists.iSOsID LEFT JOIN
Warehouse ON DispatchLists.cWhCode = Warehouse.cWhCode LEFT JOIN
Inventory ON DispatchLists.cInvCode = Inventory.cInvCode
ORDER BY DispatchLists.AutoID |
|