已审核的订单,没有生成发货单的
SELECT *
FROM v_sale_order so LEFT JOIN wms_order wo ON so.sale_order_id = wo.sale_order_id
AND wo.is_cancel = 0
AND wo.is_usable = 1
AND wo.tenant_id = 100030
WHERE so.is_usable = 1
AND so.is_checked = 1
AND so.is_to_be_shipped = 1
AND so.tenant_id = 100030
AND so.platform_order_status not in ("TRADE_FINISHED","TRADE_CLOSED")
AND wo.wms_order_id IS NULL;
注意:
1.left join on后面添加的是右表的过滤条件,对于左表的条件 无效果
2.where 会对左右表都进行过滤
欢迎大家访问:
我的博客