You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

25 lines
417 B

--begin q17
-- $ID$
-- TPC-H/TPC-R Small-Quantity-Order Revenue Query (Q17)
-- Functional Query Definition
-- Approved February 1998
:x
:o
select
sum(l_extendedprice) / 7.0 as avg_yearly
from
tpch.lineitem,
tpch.part
where
p_partkey = l_partkey
and p_brand = ':1'
and p_container = ':2'
and l_quantity < (
select
0.2 * avg(l_quantity)
from
tpch.lineitem
where
l_partkey = p_partkey
);
--end q17