Sunday, 25 September 2022

Postgresql - Compare two tables and identify & change rows

 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 ;

No comments:

Snowflake - Notes

WPRKSPACES -  In September 2025, Snowflake introduced Workspaces, which combines the functionality of Worksheets, Notebooks, File Manager, Q...