text: -- @(#)3.sql	2.1.8.1
  -- TPC-H/TPC-R Shipping Priority Query (Q3)
  -- Functional Query Definition
  -- Approved February 1998
  :b
  :x
  :o
  :n 10
  SELECT
  	L_ORDERKEY, 
  	SUM(L_EXTENDEDPRICE*(1-L_DISCOUNT))AS REVENUE, 
  	O_ORDERDATE, 
  	O_SHIPPRIORITY
  FROM 
  	CUSTOMER, 
  	ORDERS, 
  	LINEITEM
  WHERE 
  	C_MKTSEGMENT = ':1' 
  	AND C_CUSTKEY = O_CUSTKEY 
  	AND L_ORDERKEY = O_ORDERKEY 
  	AND O_ORDERDATE < ':2' 
  	AND L_SHIPDATE > ':2'
  GROUP BY 
  	L_ORDERKEY, 
  	O_ORDERDATE, 
  	O_SHIPPRIORITY
  ORDER BY 
  	REVENUE DESC, 
  	O_ORDERDATE
  :e	