should be it
This commit is contained in:
29
external/duckdb/benchmark/tpch_plan_cost/queries/q15.sql
vendored
Normal file
29
external/duckdb/benchmark/tpch_plan_cost/queries/q15.sql
vendored
Normal file
@@ -0,0 +1,29 @@
|
||||
WITH revenue AS (
|
||||
SELECT
|
||||
l_suppkey AS supplier_no,
|
||||
sum(l_extendedprice * (1 - l_discount)) AS total_revenue
|
||||
FROM
|
||||
lineitem
|
||||
WHERE
|
||||
l_shipdate >= CAST('1996-01-01' AS date)
|
||||
AND l_shipdate < CAST('1996-04-01' AS date)
|
||||
GROUP BY
|
||||
supplier_no
|
||||
)
|
||||
SELECT
|
||||
s_suppkey,
|
||||
s_name,
|
||||
s_address,
|
||||
s_phone,
|
||||
total_revenue
|
||||
FROM
|
||||
supplier,
|
||||
revenue
|
||||
WHERE
|
||||
s_suppkey = supplier_no
|
||||
AND total_revenue = (
|
||||
SELECT
|
||||
max(total_revenue)
|
||||
FROM revenue)
|
||||
ORDER BY
|
||||
s_suppkey;
|
||||
Reference in New Issue
Block a user