From f538d21e6cb9943a9b90821be91df525c21b66d3 Mon Sep 17 00:00:00 2001 From: Anna Saiapina Date: Wed, 28 Feb 2024 14:28:50 +0000 Subject: [PATCH] Table connects all fields connected to CAMPAIGN --- definitions/staging/CAMPAIGN.sqlx | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 definitions/staging/CAMPAIGN.sqlx diff --git a/definitions/staging/CAMPAIGN.sqlx b/definitions/staging/CAMPAIGN.sqlx new file mode 100644 index 0000000..dd2280d --- /dev/null +++ b/definitions/staging/CAMPAIGN.sqlx @@ -0,0 +1,22 @@ +config { + type: "view", + schema: "pphe_five9_stg", + tags: ["snapdaily"], + description: "All fields that are connected to the CAMPAIGN" +} + +select c.CAMPAIGN, + c.CAMPAIGN_ID, + cg.campaign_group_id, + cgi.campaign_group, + cit.CAMPAIGN_TYPE_ID, + ct.CAMPAIGN_TYPE +from ${ref("stg_MAPPING_CAMPAIGN")} c +join ${ref("stg_MAPPING_CAMPAIGN_GROUP")} cg +on c.CAMPAIGN_ID = cg.CAMPAIGN_ID +join ${ref("stg_MAPPING_CAMPAIGN_GROUP_ID")} cgi +on cg.campaign_group_id = cgi.campaign_group_id +join ${ref("stg_MAPPING_CAMPAIGN_ID_TYPE")} cit +on c.CAMPAIGN_ID = cit.CAMPAIGN_ID +join ${ref("stg_MAPPING_CAMPAIGN_TYPE")} ct +on ct.CAMPAIGN_TYPE_ID = cit.CAMPAIGN_TYPE_ID \ No newline at end of file