github.com/matrixorigin/matrixone@v1.2.0/pkg/sql/plan/tpch/q18.sql (about) 1 select 2 c_name, 3 c_custkey, 4 o_orderkey, 5 o_orderdate, 6 o_totalprice, 7 sum(l_quantity) 8 from 9 customer, 10 orders, 11 lineitem 12 where 13 o_orderkey in ( 14 select 15 l_orderkey 16 from 17 lineitem 18 group by 19 l_orderkey having 20 sum(l_quantity) > 314 21 ) 22 and c_custkey = o_custkey 23 and o_orderkey = l_orderkey 24 group by 25 c_name, 26 c_custkey, 27 o_orderkey, 28 o_orderdate, 29 o_totalprice 30 order by 31 o_totalprice desc, 32 o_orderdate 33 limit 100 34 ;