mirror of
https://github.com/neondatabase/neon.git
synced 2026-01-06 04:52:55 +00:00
26 lines
392 B
SQL
26 lines
392 B
SQL
|
|
-- $ID$
|
|
-- TPC-H/TPC-R Small-Quantity-Order Revenue Query (Q17)
|
|
-- Functional Query Definition
|
|
-- Approved February 1998
|
|
|
|
|
|
select
|
|
sum(l_extendedprice) / 7.0 as avg_yearly
|
|
from
|
|
lineitem,
|
|
part
|
|
where
|
|
p_partkey = l_partkey
|
|
and p_brand = 'Brand#35'
|
|
and p_container = 'JUMBO JAR'
|
|
and l_quantity < (
|
|
select
|
|
0.2 * avg(l_quantity)
|
|
from
|
|
lineitem
|
|
where
|
|
l_partkey = p_partkey
|
|
)
|
|
;
|