Changed case to coalesce
This commit is contained in:
parent
3b22832d8b
commit
5bd6a2c254
1 changed files with 8 additions and 16 deletions
|
|
@ -35,26 +35,18 @@ select
|
||||||
case when gss.is_contactable is true then u.email else '' end as guest_email,
|
case when gss.is_contactable is true then u.email else '' end as guest_email,
|
||||||
gss.experience_rating,
|
gss.experience_rating,
|
||||||
gss.guest_comments,
|
gss.guest_comments,
|
||||||
case when gss.is_contactable is true then true else false end as is_contactable,
|
coalesce(gss.is_contactable, false) as is_contactable,
|
||||||
gss.created_at_utc,
|
gss.created_at_utc,
|
||||||
gss.updated_at_utc,
|
gss.updated_at_utc,
|
||||||
case
|
coalesce(
|
||||||
when v.verification_value is not null
|
v.verification_value, 'No Payment Validation Option'
|
||||||
then v.verification_value
|
) as selected_payment_option,
|
||||||
else 'No Payment Validation Option'
|
|
||||||
end as selected_payment_option,
|
|
||||||
u.date_of_birth,
|
u.date_of_birth,
|
||||||
extract(year from age(u.date_of_birth)) as age_of_guest,
|
extract(year from age(u.date_of_birth)) as age_of_guest,
|
||||||
case
|
coalesce(pt.has_check_in_cover_payment, false) as has_check_in_cover_payment,
|
||||||
when pt.has_check_in_cover_payment is true then true else false
|
coalesce(pt.has_waiver_payment, false) as has_waiver_payment,
|
||||||
end as has_check_in_cover_payment,
|
coalesce(pt.has_deposit_payment, false) as has_deposit_payment,
|
||||||
case
|
coalesce(pt.has_fee_payment, false) as has_fee_payment
|
||||||
when pt.has_waiver_payment is true then true else false
|
|
||||||
end as has_waiver_payment,
|
|
||||||
case
|
|
||||||
when pt.has_deposit_payment is true then true else false
|
|
||||||
end as has_deposit_payment,
|
|
||||||
case when pt.has_fee_payment is true then true else false end as has_fee_payment
|
|
||||||
from staging.stg_core__guest_satisfaction_responses gss
|
from staging.stg_core__guest_satisfaction_responses gss
|
||||||
left join
|
left join
|
||||||
staging.stg_core__verification_request vr
|
staging.stg_core__verification_request vr
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue