table alias

This commit is contained in:
Pablo Martin 2024-06-25 11:44:00 +02:00
parent 200c324b68
commit bf54548654

View file

@ -3,35 +3,37 @@ with
select * from {{ ref("stg_xero__bank_transactions") }} select * from {{ ref("stg_xero__bank_transactions") }}
) )
select select
id_bank_transaction, bt.id_bank_transaction,
id_prepayment, bt.id_prepayment,
id_overpayment, bt.id_overpayment,
reference, bt.reference,
transaction_type, bt.transaction_type,
transaction_status, bt.transaction_status,
transaction_at_utc, bt.transaction_at_utc,
date_string, bt.date_string,
total_amount_local_curr, bt.total_amount_local_curr,
(total_amount_local_curr * exchange_rate_to_gbp)::numeric( (bt.total_amount_local_curr * bt.exchange_rate_to_gbp)::numeric(
18, 4 18, 4
) as total_amount_in_gbp, ) as total_amount_in_gbp,
total_amount_wo_tax_local_curr, bt.total_amount_wo_tax_local_curr,
(total_amount_wo_tax_local_curr * exchange_rate_to_gbp)::numeric( (bt.total_amount_wo_tax_local_curr * bt.exchange_rate_to_gbp)::numeric(
18, 4 18, 4
) as total_amount_wo_tax_in_gbp, ) as total_amount_wo_tax_in_gbp,
total_tax_local_curr, bt.total_tax_local_curr,
(total_tax_local_curr * exchange_rate_to_gbp)::numeric(18, 4) as total_tax_in_gbp, (bt.total_tax_local_curr * bt.exchange_rate_to_gbp)::numeric(
transaction_currency_iso_4217, 18, 4
exchange_rate_to_gbp, ) as total_tax_in_gbp,
line_amount_tax_inclusiveness, bt.transaction_currency_iso_4217,
full_contact_details, bt.exchange_rate_to_gbp,
line_items, bt.line_amount_tax_inclusiveness,
bank_account, bt.full_contact_details,
is_reconciled, bt.line_items,
has_attachments, bt.bank_account,
url, bt.is_reconciled,
external_link_provider_name, bt.has_attachments,
updated_at_utc, bt.url,
updated_date_utc, bt.external_link_provider_name,
dwh_extracted_at_utc bt.updated_at_utc,
from stg_xero__bank_transactions bt.updated_date_utc,
bt.dwh_extracted_at_utc
from stg_xero__bank_transactions bt