17 lines
360 B
SQL
17 lines
360 B
SQL
-- @(#)6.sql 2.1.8.1
|
|
-- TPC-H/TPC-R Forecasting Revenue Change Query (Q6)
|
|
-- Functional Query Definition
|
|
-- Approved February 1998
|
|
:x
|
|
:o
|
|
select
|
|
sum(l_extendedprice * l_discount) as revenue
|
|
from
|
|
lineitem
|
|
where
|
|
l_shipdate >= date ':1'
|
|
and l_shipdate < date ':1' + interval '1' year
|
|
and l_discount between :2 - 0.01 and :2 + 0.01
|
|
and l_quantity < :3;
|
|
:n -1
|