首页 新闻 会员 周边

这个sql还能优化吗???

0
[待解决问题]
 SELECT 
0 AS Shift_ID,
Waybill_ProductTypeID,
cast(COUNT(1) as decimal) AS CalculateCount,
SUM(WaybillGood_CalculateWeight) AS CalculateWeight,
cast(sum((isnull(Waybill_Weight,0)/Waybill_PredictPackageCount)) as decimal(12,2)) as [Weight],
5 AS Stage --没有预计车次的在库
FROM dbo.WaybillGood 
INNER JOIN Waybill ON  Waybill_ID = WaybillGood_WaybillID
WHERE WaybillGood_StationID =@StationID and WaybillGood_ShiftID = 0 and WaybillGood_SupplierCommissionID =0 AND WaybillGood_LastCheckIOTime > '2016-01-01 8:00:00' 
GROUP BY Waybill_ProductTypeID
 
=================
这个还可以优化吗
sql
IDOER的主页 IDOER | 初学一级 | 园豆:19
提问于:2017-05-13 11:11
< >
分享
所有回答(1)
0

  当然可以,创建索引

悦光阴 | 园豆:2251 (老鸟四级) | 2017-05-16 13:04
清除回答草稿
   您需要登录以后才能回答,未注册用户请先注册