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

     1  use tpch;
     2  select
     3      ps_partkey,
     4      sum(ps_supplycost * ps_availqty) as value
     5  from
     6      partsupp,
     7      supplier,
     8      nation
     9  where
    10      ps_suppkey = s_suppkey
    11      and s_nationkey = n_nationkey
    12      and n_name = 'JAPAN'
    13  group by
    14      ps_partkey having
    15          sum(ps_supplycost * ps_availqty) > (
    16          select
    17              sum(ps_supplycost * ps_availqty) * 0.0001000000
    18                  from
    19                  partsupp,
    20                  supplier,nation
    21              where
    22                  ps_suppkey = s_suppkey
    23                  and s_nationkey = n_nationkey
    24                  and n_name = 'JAPAN'
    25          )
    26  order by
    27      value desc
    28  ;