diff --git a/models/staging/exchange/stg_exchange__transaction_costs.sql b/models/staging/exchange/stg_exchange__transaction_costs.sql index cf26246..2b4ff03 100644 --- a/models/staging/exchange/stg_exchange__transaction_costs.sql +++ b/models/staging/exchange/stg_exchange__transaction_costs.sql @@ -73,27 +73,6 @@ transactions_join_transaction_types_payment_methods_currencies_status AS ( ), -remove_deleted_row AS ( - SELECT - * - - FROM transactions_join_transaction_types_payment_methods_currencies_status - - WHERE deleted_datetime IS NULL -), - --- It will seldom offur system error, so we assume that the latest cost is correct. But it is not a correct assumption -remove_system_error_duplicate_row AS ( - SELECT - *, - ROW_NUMBER() OVER (PARTITION BY transaction_order_id ORDER BY updated_datetime DESC) AS row_number_index - - FROM remove_deleted_row - - QUALIFY - row_number_index = 1 -), - -- FINAL final__stg_exchange__transaction_costs AS ( @@ -130,7 +109,7 @@ final__stg_exchange__transaction_costs AS ( -- metadata _dbt_ran_datetime - FROM remove_system_error_duplicate_row + FROM transactions_join_transaction_types_payment_methods_currencies_status ) -SELECT * FROM remove_system_error_duplicate_row \ No newline at end of file +SELECT * FROM final__stg_exchange__transaction_costs \ No newline at end of file