blob: 3375002c5fd44f7227ae3e5abc6d3dac4fdd3ac8 [file] [log] [blame]
-- using default substitutions
select
c_count,
count(*) as custdist
from
(
select
c_custkey,
count(o_orderkey) as c_count
from
customer left outer join orders on
c_custkey = o_custkey
and o_comment not like '%special%requests%'
group by
c_custkey
) as c_orders
group by
c_count
order by
custdist desc,
c_count desc