use it in downstream
This commit is contained in:
parent
999ae0dd10
commit
1a347c721b
1 changed files with 6 additions and 3 deletions
|
|
@ -2,15 +2,18 @@ with
|
||||||
stg_core__verification_to_payment as (
|
stg_core__verification_to_payment as (
|
||||||
select * from {{ ref("stg_core__verification_to_payment") }}
|
select * from {{ ref("stg_core__verification_to_payment") }}
|
||||||
),
|
),
|
||||||
|
stg_core__verification_payment_type as (
|
||||||
|
select * from {{ ref("stg_core__verification_payment_type") }}
|
||||||
|
),
|
||||||
monster_payment_join as (
|
monster_payment_join as (
|
||||||
select vtp.*, vpt.*, p.*, ps."Name"
|
select vtp.*, vpt.*, p.*, ps."Name"
|
||||||
from stg_core__verification_to_payment vtp
|
from stg_core__verification_to_payment vtp
|
||||||
left join
|
left join
|
||||||
sync_core."VerificationPaymentType" vpt
|
stg_core__verification_payment_type vpt
|
||||||
on vtp.id_verification_to_payment = vpt."Id"
|
on vtp.id_verification_to_payment = vpt.id_verification_payment_type
|
||||||
left join sync_core."Payment" p on vtp.id_payment = p."PaymentId"
|
left join sync_core."Payment" p on vtp.id_payment = p."PaymentId"
|
||||||
left join sync_core."PaymentStatus" ps on p."PaymentStatusId" = ps."Id"
|
left join sync_core."PaymentStatus" ps on p."PaymentStatusId" = ps."Id"
|
||||||
where vpt."Name" = 'Fee' -- and vtp."VerificationId" = 800000
|
where vpt.verification_payment_type = 'Fee'
|
||||||
)
|
)
|
||||||
select payment_due_at_utc, "Amount" as amount
|
select payment_due_at_utc, "Amount" as amount
|
||||||
from monster_payment_join
|
from monster_payment_join
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue