select distinct right(order_id,4) product_id,count(order_id) cnt
from order_log
group by product_id