子查询: select count(1) from wh_order where state!="X" and ORDER_NO not in(select ORDER_NO from wh_order_assign where wh_order_assign.state!="X" );
exists:
select count(1) from wh_order a where state!="X" and not exists (select * from wh_order_assign b where b.state!="X" and a.ORDER_NO=b.ORDER_NO );