select product_id, count(1) as cnt from ( select substring_index(order_id, '_', -1) as product_id from order_log ) temp group by product_id order by product_id