zuora_assert_no_circular_linkages.sql 393 Bytes
Newer Older
1 2 3 4 5 6 7 8 9 10
--no direct circular subscriptions

WITH base AS (

  SELECT
    subscription_name_slugify,
    c.value::string AS zuora_renewal_subscription_name_slugify
  FROM {{ref('zuora_subscription_intermediate')}},
  lateral flatten(input =>zuora_renewal_subscription_name_slugify) C
  WHERE c.index != 0
11

12
)
13

14 15
SELECT *
FROM base
16
WHERE subscription_name_slugify = zuora_renewal_subscription_name_slugify