| ==== |
| ---- QUERY: TPCH-Q13 |
| # Q13 - Customer Distribution Query |
| 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 |
| ---- RESULTS |
| 0,50005 |
| 9,6641 |
| 10,6532 |
| 11,6014 |
| 8,5937 |
| 12,5639 |
| 13,5024 |
| 19,4793 |
| 7,4687 |
| 17,4587 |
| 18,4529 |
| 20,4516 |
| 15,4505 |
| 14,4446 |
| 16,4273 |
| 21,4190 |
| 22,3623 |
| 6,3265 |
| 23,3225 |
| 24,2742 |
| 25,2086 |
| 5,1948 |
| 26,1612 |
| 27,1179 |
| 4,1007 |
| 28,893 |
| 29,593 |
| 3,415 |
| 30,376 |
| 31,226 |
| 32,148 |
| 2,134 |
| 33,75 |
| 34,50 |
| 35,37 |
| 1,17 |
| 36,14 |
| 38,5 |
| 37,5 |
| 40,4 |
| 41,2 |
| 39,1 |
| ---- TYPES |
| BIGINT, BIGINT |
| ==== |