text: -- @(#)3.sql	2.1.8.1
  -- TPC-H/TPC-R Shipping Priority Query (Q3)
  -- Functional Query Definition
  -- Approved February 1998
  :b
  :x
  :o
  select
  	l_orderkey,
  	sum(l_extendedprice * (1 - l_discount)) as revenue,
  	o_orderdate,
  	o_shippriority
  from
  	q3
  where
  	c_mktsegment = ':1'
  	and o_orderdate < date ':2'
  	and l_shipdate > date ':2'
  group by
  	l_orderkey,
  	o_orderdate,
  	o_shippriority
  order by
  	revenue desc,
  	o_orderdate
  :n 10;
  :e
  