db13.sql 360 字节
Newer Older
F
v1.6.0  
frf12 已提交
1 2 3 4 5 6 7
-- using default substitutions
SELECT  /*+   TPCH_Q13 parallel(cpu_num) */ c_count, count(*) as custdist
from ( SELECT c_custkey, count(o_orderkey)  as  c_count
       from customer left join orders on c_custkey = o_custkey and o_comment not like '%special%requests%'
       group by c_custkey ) c_orders
group by c_count
order by custdist desc, c_count desc;