select cast(sum(case when product_id is null then 1 else 0 end) as signed ) as cnt from order_log right join user_info using(uid)