datafusion-sqlparse/tests/queries/tpch/11.sql
Daniël Heres 5cab18963e
Add TPCH reggression tests (#221)
* Add TPC-H reggression tests
2020-07-14 21:48:07 +02:00

30 lines
545 B
SQL

-- using default substitutions
select
ps_partkey,
sum(ps_supplycost * ps_availqty) as value
from
partsupp,
supplier,
nation
where
ps_suppkey = s_suppkey
and s_nationkey = n_nationkey
and n_name = 'GERMANY'
group by
ps_partkey having
sum(ps_supplycost * ps_availqty) > (
select
sum(ps_supplycost * ps_availqty) * 0.0001000000
from
partsupp,
supplier,
nation
where
ps_suppkey = s_suppkey
and s_nationkey = n_nationkey
and n_name = 'GERMANY'
)
order by
value desc;