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

redshiftTableauQueries.14.sql Maven / Gradle / Ivy

There is a newer version: 0.5.8
Show newest version
SELECT (NOT ("t0"."_tableau_join_flag" IS NULL)) AS "io_promo_tpe_nk",
  SUM(("lineitem"."l_extendedprice" * (1 - "lineitem"."l_discount"))) AS "sum_calculation_7060711085256495_ok"
FROM "tpch10g"."lineitem" "lineitem"
  INNER JOIN "tpch10g"."part" "part" ON ("lineitem"."l_partkey" = "part"."p_partkey")
  LEFT JOIN (
  SELECT COUNT(1) AS "_tableau_join_flag",
    "part"."p_type" AS "p_type"
  FROM "tpch10g"."lineitem" "lineitem"
    INNER JOIN "tpch10g"."part" "part" ON ("lineitem"."l_partkey" = "part"."p_partkey")
  WHERE (SUBSTRING("part"."p_type", 1, LENGTH('PROMO')) = 'PROMO')
  GROUP BY 2
) "t0" ON (("part"."p_type" = "t0"."p_type") OR (("part"."p_type" IS NULL) AND ("t0"."p_type" IS NULL)))
WHERE (("lineitem"."l_shipdate" >= DATEADD(MONTH,0,CAST(DATE_TRUNC( 'MONTH', CAST((TIMESTAMP '1995-09-01 00:00:00.000') AS TIMESTAMP WITHOUT TIME ZONE) ) AS TIMESTAMP WITHOUT TIME ZONE))) AND ("lineitem"."l_shipdate" < DATEADD(MONTH,1,CAST(DATE_TRUNC( 'MONTH', CAST((TIMESTAMP '1995-09-01 00:00:00.000') AS TIMESTAMP WITHOUT TIME ZONE) ) AS TIMESTAMP WITHOUT TIME ZONE))))
GROUP BY 1




© 2015 - 2025 Weber Informatics LLC | Privacy Policy