All pastes #624876 Raw Edit

Mine

public text v1 · immutable
#624876 ·published 2007-07-18 16:22 UTC
rendered paste body
select 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