github.com/matrixorigin/matrixone@v1.2.0/test/distributed/cases/benchmark/tpch/03_QUERIES/q2.sql (about)

     1  use tpch;
     2  select
     3  	s_acctbal,
     4  	s_name,
     5  	n_name,
     6  	p_partkey,
     7  	p_mfgr,
     8  	s_address,
     9  	s_phone,
    10  	s_comment
    11  from
    12  	part,
    13  	supplier,
    14  	partsupp,
    15  	nation,
    16  	region
    17  where
    18  	p_partkey = ps_partkey
    19  	and s_suppkey = ps_suppkey
    20  	and p_size = 48
    21  	and p_type like '%TIN'
    22  	and s_nationkey = n_nationkey
    23  	and n_regionkey = r_regionkey
    24  	and r_name = 'MIDDLE EAST'
    25  	and ps_supplycost = (
    26  		select
    27  			min(ps_supplycost)
    28  		from
    29  			partsupp,
    30  			supplier,
    31  			nation,
    32  			region
    33  		where
    34  			p_partkey = ps_partkey
    35  			and s_suppkey = ps_suppkey
    36  			and s_nationkey = n_nationkey
    37  			and n_regionkey = r_regionkey
    38  			and r_name = 'MIDDLE EAST'
    39  	)
    40  order by
    41  	s_acctbal desc,
    42  	n_name,
    43  	s_name,
    44  	p_partkey
    45  limit 100
    46  ;