Skip to content

Instantly share code, notes, and snippets.

@unknowntpo
Created September 2, 2022 03:10
Show Gist options
  • Save unknowntpo/866f84ccb269993d42c8a39f22be24fa to your computer and use it in GitHub Desktop.
Save unknowntpo/866f84ccb269993d42c8a39f22be24fa to your computer and use it in GitHub Desktop.
db_version_control.add_or_modified
id c0 c1 username version is_deleted
4 old2 old2 Eric 2 f
3 modified old1 Kevin 2 f
5 new0 new1 Kevin 2 f
with add_or_modified as (
select * from join_table
where data_id is null
)
update temp set username = 'Kevin'
where id in (select temp_id from add_or_modified);
select * from temp;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment