Mine
public text v1 · immutableselect store_num, count(*) custcount from (
select store_num, concat(area_code,phone_num), count(concat(area_code,phone_num))
from orders_p
where ord_date>='00000000' and ord_date<='20070128' and store_num=1
group by concat(area_code,phone_num)
) ordpsub group by store_num