redshiftTableauQueries.3.sql Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of verdictdb-core Show documentation
Show all versions of verdictdb-core Show documentation
Platform-independent, interactive-speed data analytics system
SELECT "lineitem"."l_orderkey" AS "l_orderkey",
"orders"."o_orderdate" AS "o_orderdate",
"orders"."o_shippriority" AS "o_shippriority",
SUM(("lineitem"."l_extendedprice" * (1 - "lineitem"."l_discount"))) AS "sum_calculation_7060711085256495_ok"
FROM "tpch10g"."lineitem" "lineitem"
INNER JOIN "tpch10g"."orders" "orders" ON ("lineitem"."l_orderkey" = "orders"."o_orderkey")
INNER JOIN "tpch10g"."supplier" "supplier" ON ("lineitem"."l_suppkey" = "supplier"."s_suppkey")
INNER JOIN "tpch10g"."customer" "customer" ON ("orders"."o_custkey" = "customer"."c_custkey")
INNER JOIN "tpch10g"."nation" "N1" ON ("customer"."c_nationkey" = "N1"."n_nationkey")
INNER JOIN (
SELECT TOP 10 "orders"."o_orderkey" AS "o_orderkey",
COUNT(1) AS "_tableau_join_flag",
SUM(("lineitem"."l_extendedprice" * (1 - "lineitem"."l_discount"))) AS "___alias__0"
FROM "tpch10g"."lineitem" "lineitem"
INNER JOIN "tpch10g"."orders" "orders" ON ("lineitem"."l_orderkey" = "orders"."o_orderkey")
INNER JOIN "tpch10g"."supplier" "supplier" ON ("lineitem"."l_suppkey" = "supplier"."s_suppkey")
INNER JOIN "tpch10g"."customer" "customer" ON ("orders"."o_custkey" = "customer"."c_custkey")
INNER JOIN "tpch10g"."nation" "N1" ON ("customer"."c_nationkey" = "N1"."n_nationkey")
WHERE (((NOT ("supplier"."s_nationkey" IS NULL)) AND (((NOT ("N1"."n_regionkey" IS NULL)) AND (NOT ("lineitem"."l_partkey" IS NULL))) AND (NOT ("lineitem"."l_partkey" IS NULL)))) AND (("lineitem"."l_shipdate" > (DATE '1995-03-15')) AND ("orders"."o_orderdate" < (DATE '1995-03-15')) AND ("customer"."c_mktsegment" = 'BUILDING')))
GROUP BY 1
ORDER BY 3 DESC
) "t0" ON ("orders"."o_orderkey" = "t0"."o_orderkey")
WHERE (((NOT ("supplier"."s_nationkey" IS NULL)) AND (((NOT ("N1"."n_regionkey" IS NULL)) AND (NOT ("lineitem"."l_partkey" IS NULL))) AND (NOT ("lineitem"."l_partkey" IS NULL)))) AND (("lineitem"."l_shipdate" > (DATE '1995-03-15')) AND ("orders"."o_orderdate" < (DATE '1995-03-15')) AND ("customer"."c_mktsegment" = 'BUILDING')))
GROUP BY 1,
2,
3
© 2015 - 2025 Weber Informatics LLC | Privacy Policy