Skip to content

Commit

Permalink
fix CTE table names
Browse files Browse the repository at this point in the history
  • Loading branch information
folhesgabriel committed Apr 5, 2024
1 parent 42251f6 commit bb20583
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions models/br_ms_sia/br_ms_sia__producao_ambulatorial.sql
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ with
on producao_ambulatorial.pa_ufmun = mun.id_municipio_6
),

producao_ambulatorial as (
sia as (

select
safe_cast(ano as int64) ano,
Expand Down Expand Up @@ -223,12 +223,12 @@ with
)

select *
from producao_ambulatorial
from sia

{% if is_incremental() %}
left join
{{ this }} as materialized
on sia_add_municipios.ano = materialized.ano
and sia_add_municipios.mes = materialized.mes
on sia.ano = materialized.ano
and sia.mes = materialized.mes
where materialized.ano is null and materialized.mes is null
{% endif %}

0 comments on commit bb20583

Please sign in to comment.