should be it
This commit is contained in:
33
external/duckdb/benchmark/tpch_plan_cost/queries/q18.sql
vendored
Normal file
33
external/duckdb/benchmark/tpch_plan_cost/queries/q18.sql
vendored
Normal file
@@ -0,0 +1,33 @@
|
||||
SELECT
|
||||
c_name,
|
||||
c_custkey,
|
||||
o_orderkey,
|
||||
o_orderdate,
|
||||
o_totalprice,
|
||||
sum(l_quantity)
|
||||
FROM
|
||||
customer,
|
||||
orders,
|
||||
lineitem
|
||||
WHERE
|
||||
o_orderkey IN (
|
||||
SELECT
|
||||
l_orderkey
|
||||
FROM
|
||||
lineitem
|
||||
GROUP BY
|
||||
l_orderkey
|
||||
HAVING
|
||||
sum(l_quantity) > 300)
|
||||
AND c_custkey = o_custkey
|
||||
AND o_orderkey = l_orderkey
|
||||
GROUP BY
|
||||
c_name,
|
||||
c_custkey,
|
||||
o_orderkey,
|
||||
o_orderdate,
|
||||
o_totalprice
|
||||
ORDER BY
|
||||
o_totalprice DESC,
|
||||
o_orderdate
|
||||
LIMIT 100;
|
||||
Reference in New Issue
Block a user