summaryrefslogtreecommitdiffstats
path: root/tests/fixtures/optimizer/tpc-h
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2022-10-10 11:29:05 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2022-10-10 11:29:05 +0000
commitf818ab3b896d52e874634b7c4db3533078c1887f (patch)
tree8d0f7e4b7f165f33f49da74cb34eb31a0a2d147b /tests/fixtures/optimizer/tpc-h
parentReleasing debian version 6.2.8-1. (diff)
downloadsqlglot-f818ab3b896d52e874634b7c4db3533078c1887f.tar.xz
sqlglot-f818ab3b896d52e874634b7c4db3533078c1887f.zip
Merging upstream version 6.3.1.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'tests/fixtures/optimizer/tpc-h')
-rw-r--r--tests/fixtures/optimizer/tpc-h/tpc-h.sql13
1 files changed, 10 insertions, 3 deletions
diff --git a/tests/fixtures/optimizer/tpc-h/tpc-h.sql b/tests/fixtures/optimizer/tpc-h/tpc-h.sql
index d2f10fc..936a0af 100644
--- a/tests/fixtures/optimizer/tpc-h/tpc-h.sql
+++ b/tests/fixtures/optimizer/tpc-h/tpc-h.sql
@@ -769,13 +769,20 @@ group by
order by
custdist desc,
c_count desc;
-WITH "c_orders" AS (
+WITH "orders_2" AS (
+ SELECT
+ "orders"."o_orderkey" AS "o_orderkey",
+ "orders"."o_custkey" AS "o_custkey",
+ "orders"."o_comment" AS "o_comment"
+ FROM "orders" AS "orders"
+ WHERE
+ NOT "orders"."o_comment" LIKE '%special%requests%'
+), "c_orders" AS (
SELECT
COUNT("orders"."o_orderkey") AS "c_count"
FROM "customer" AS "customer"
- LEFT JOIN "orders" AS "orders"
+ LEFT JOIN "orders_2" AS "orders"
ON "customer"."c_custkey" = "orders"."o_custkey"
- AND NOT "orders"."o_comment" LIKE '%special%requests%'
GROUP BY
"customer"."c_custkey"
)