github.com/matrixorigin/matrixone@v1.2.0/pkg/sql/plan/tpch/q12.sql (about)

     1  select
     2  	l_shipmode,
     3  	sum(case
     4  		when o_orderpriority = '1-URGENT'
     5  			or o_orderpriority = '2-HIGH'
     6  			then 1
     7  		else 0
     8  	end) as high_line_count,
     9  	sum(case
    10  		when o_orderpriority <> '1-URGENT'
    11  			and o_orderpriority <> '2-HIGH'
    12  			then 1
    13  		else 0
    14  	end) as low_line_count
    15  from
    16  	orders,
    17  	lineitem
    18  where
    19  	o_orderkey = l_orderkey
    20  	and l_shipmode in ('FOB', 'TRUCK')
    21  	and l_commitdate < l_receiptdate
    22  	and l_shipdate < l_commitdate
    23  	and l_receiptdate >= date '1996-01-01'
    24  	and l_receiptdate < date '1996-01-01' + interval '1' year
    25  group by
    26  	l_shipmode
    27  order by
    28  	l_shipmode
    29  ;