github.com/matrixorigin/matrixone@v1.2.0/test/distributed/cases/benchmark/tpch/03_QUERIES/q10.sql (about) 1 use tpch; 2 select 3 c_custkey, 4 c_name, 5 sum(l_extendedprice * (1 - l_discount)) as revenue, 6 c_acctbal, 7 n_name, 8 c_address, 9 c_phone, 10 c_comment 11 from 12 customer, 13 orders, 14 lineitem, 15 nation 16 where 17 c_custkey = o_custkey 18 and l_orderkey = o_orderkey 19 and o_orderdate >= date '1993-03-01' 20 and o_orderdate < date '1993-03-01' + interval '3' month 21 and l_returnflag = 'R' 22 and c_nationkey = n_nationkey 23 group by 24 c_custkey, 25 c_name, 26 c_acctbal, 27 c_phone, 28 n_name, 29 c_address, 30 c_comment 31 order by 32 revenue desc 33 limit 20 34 ;