blob: 19c2909a880670f5ff3df31ce36a0692f19ad863 [file] [log] [blame]
====
---- QUERY: TPCH-Q15
# Q15 - Top Supplier Query
with revenue_view as (
select
l_suppkey as supplier_no,
sum(l_extendedprice * (1 - l_discount)) as total_revenue
from
lineitem
where
l_shipdate >= '1996-01-01'
and l_shipdate < '1996-04-01'
group by
l_suppkey)
select
s_suppkey,
s_name,
s_address,
s_phone,
total_revenue
from
supplier,
revenue_view
where
s_suppkey = supplier_no
and total_revenue = (
select
max(total_revenue)
from
revenue_view
)
order by
s_suppkey
---- RESULTS
8449,'Supplier#000008449','Wp34zim9qYFbVctdW','20-469-856-8873',1772627.2087
---- TYPES
BIGINT, STRING, STRING, STRING, DECIMAL
====