Be Good. Do Good.
INSERT INTO target
(id, name, location, flag,ad_org_id)
(
SELECT
s.id, s.name, s.location, s.flag,s.ad_org_id
FROM source s
)
ON CONFLICT (id,ad_org_id)
DO UPDATE
SET
name = excluded.name,
location = excluded.location,
flag=excluded.flag ;
Models are where your developers spend most of their time within a dbt environment. Models are primarily written as a select statement and ...