blob: e0ff4e9bc29dddaf390fc7e6b669bf82049f1d82 [file] [log] [blame]
====
---- QUERY: TPCH-Q1
# Q1 - Pricing Summary Report Query
select
l_returnflag,
l_linestatus,
sum(l_quantity) as sum_qty,
sum(l_extendedprice) as sum_base_price,
sum(l_extendedprice * (1 - l_discount)) as sum_disc_price,
sum(l_extendedprice * (1 - l_discount) * (1 + l_tax)) as sum_charge,
avg(l_quantity) as avg_qty,
avg(l_extendedprice) as avg_price,
avg(l_discount) as avg_disc,
count(*) as count_order
from
customer.c_orders.o_lineitems
where
l_shipdate <= '1998-09-02'
group by
l_returnflag,
l_linestatus
order by
l_returnflag,
l_linestatus
---- RESULTS
'A','F',37734107.00,56586554400.73,53758257134.8700,55909065222.827692,25.52,38273.12,0.04,1478493
'N','F',991417.00,1487504710.38,1413082168.0541,1469649223.194375,25.51,38284.46,0.05,38854
'N','O',74476040.00,111701729697.74,106118230307.6056,110367043872.497010,25.50,38249.11,0.04,2920374
'R','F',37719753.00,56568041380.90,53741292684.6040,55889619119.831932,25.50,38250.85,0.05,1478870
---- TYPES
string, string, decimal, decimal, decimal, decimal, decimal, decimal, decimal, bigint
====