All Downloads are FREE. Search and download functionalities are using the official Maven repository.

redshiftTableauQueries.9.sql Maven / Gradle / Ivy

There is a newer version: 0.5.8
Show newest version
SELECT "N2"."n_name" AS "n_name",
  CAST(EXTRACT(YEAR FROM CAST("orders"."o_orderdate" AS TIMESTAMP WITHOUT TIME ZONE)) AS INTEGER) AS "yr_o_orderdate_ok",
  SUM((("lineitem"."l_extendedprice" * (1 - "lineitem"."l_discount")) - ("partsupp"."ps_supplycost" * "lineitem"."l_quantity"))) AS "sum_calculation_1690805085450945_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"."nation" "N2" ON ("supplier"."s_nationkey" = "N2"."n_nationkey")
  INNER JOIN "tpch10g"."part" "part" ON ("lineitem"."l_partkey" = "part"."p_partkey")
  INNER JOIN "tpch10g"."partsupp" "partsupp" ON (("lineitem"."l_partkey" = "partsupp"."ps_partkey") AND ("lineitem"."l_suppkey" = "partsupp"."ps_suppkey"))
WHERE (STRPOS("part"."p_name",'green') > 0)
GROUP BY 1,
  2




© 2015 - 2025 Weber Informatics LLC | Privacy Policy