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.
 
 
 
 
 
 

18 lines
398 B

-- $ID$
-- TPC-H/TPC-R Promotion Effect Query (Q14)
-- Variant A
-- Approved March 1998
:x
:o
select
100.00 * sum(decode(substring(p_type from 1 for 5), 'PROMO',
l_extendedprice * (1-l_discount), 0)) /
sum(l_extendedprice * (1-l_discount)) as promo_revenue
from
lineitem,
part
where
l_partkey = p_partkey
and l_shipdate >= date ':1'
and l_shipdate < date ':1' + interval '1' month;
:n -1