计算利润,成本都没有问题。计算“订单增长量” 计算出来全是零,各路大神这个是什么问题?
week1.订单量 -- 正常 week2.订单量 -- 正常 (week1.订单量-week2.订单量) -- 正常 (week1.订单量-week2.订单量)/week2.订单量 -- 异常
SELECT week1.平台,week1.店铺名称,week1.订单量,week2.订单量,(week1.订单量-week2.订单量),((week1.订单量-week2.订单量)/week2.订单量) AS 订单增长量 FROM ( SELECT 平台,店铺名称,周,订单量, 成本,实收,利润 FROM #week_profits where 周=1 ) week1 ,( SELECT 平台,店铺名称,周,订单量, 成本,实收,利润 FROM #week_profits where 周=2 ) week2