mirror of
https://github.com/neondatabase/neon.git
synced 2026-01-10 06:52:55 +00:00
21 lines
429 B
SQL
21 lines
429 B
SQL
-- $ID$
|
|
-- TPC-H/TPC-R Promotion Effect Query (Q14)
|
|
-- Functional Query Definition
|
|
-- Approved February 1998
|
|
|
|
|
|
select
|
|
100.00 * sum(case
|
|
when p_type like 'PROMO%'
|
|
then l_extendedprice * (1 - l_discount)
|
|
else 0
|
|
end) / sum(l_extendedprice * (1 - l_discount)) as promo_revenue
|
|
from
|
|
lineitem,
|
|
part
|
|
where
|
|
l_partkey = p_partkey
|
|
and l_shipdate >= date '1995-07-01'
|
|
and l_shipdate < date '1995-07-01' + interval '1' month
|
|
;
|