with t1 as (select u.uid from user_info u left join (select uid from order_log group by uid) as b on u.uid = b.uid where b.uid is null) select count(uid) as cnt from t1