mirror of
https://github.com/apache/datafusion-sqlparser-rs.git
synced 2025-08-02 21:22:15 +00:00
16 lines
366 B
SQL
16 lines
366 B
SQL
-- using default substitutions
|
|
|
|
|
|
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-09-01'
|
|
and l_shipdate < date '1995-09-01' + interval '1' month;
|