Advertisement
deCreative

UTF

Mar 19th, 2019
638
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.86 KB | None | 0 0
  1. select `t`.`source` AS `source`,sum((case when ((`t`.`current_status` = 'Delivered') and (`m`.`wms_status` <> 9)) then 1 else 0 end)) AS `delivered`,sum((case when ((`t`.`current_status` = 'Shipped') or ((`t`.`current_status` = 'pickup') and (`m`.`wms_status` <> 9))) then 1 else 0 end)) AS `shipped`,sum((case when ((`t`.`current_status` = 'Process') and (`m`.`wms_status` <> 9)) then 1 else 0 end)) AS `processing`,sum((case when ((`t`.`current_status` = 'Enter') and (`m`.`wms_status` <> 9)) then 1 else 0 end)) AS `enter`,sum((case when ((`m`.`awb` = '') or (isnull(`m`.`awb`) and (`m`.`wms_status` <> 9))) then 1 else 0 end)) AS `no_status`,sum((case when (`m`.`wms_status` = 9) then 1 else 0 end)) AS `cancel` from (`marketplace_data` `m` left join `tracking_orders` `t` on((`m`.`order_number` = convert(`t`.`order_number` using utf8)))) where (`t`.`source` = 'MP-SHOPEE') )
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement