-- SET @pbi_datetime = '2018-01-01 10:00:10'

-- POPULATE DIM_AGE
insert into `dim_age`
(pk_dim_age, age, inserted_at)
select m.age, m.age, @db_date_time as inserted_at from `bim_stg_age` m
WHERE NOT EXISTS (SELECT s.age FROM `dim_age` s)
order by m.age;

-- {{IF_ANALYZE}}dim_age{{/IF_ANALYZE}}