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

     1  use tpch;
     2  select
     3      o_orderpriority,
     4      count(*) as order_count
     5  from
     6      orders
     7  where
     8      o_orderdate >= date '1997-07-01'
     9      and o_orderdate < date '1997-07-01' + interval '3' month
    10      and exists (
    11          select
    12              *
    13          from
    14              lineitem
    15          where
    16              l_orderkey = o_orderkey
    17              and l_commitdate < l_receiptdate
    18      )
    19  group by
    20      o_orderpriority
    21  order by
    22      o_orderpriority
    23  ;