temp_id | temp_c0 | temp_username | temp_version |
---|---|---|---|
4 | old2 | Eric | 2 |
Last active
September 2, 2022 03:22
-
-
Save unknowntpo/6834a47b7ef31e4fe1ac2565a9ca76ab to your computer and use it in GitHub Desktop.
db_version_control.no-change
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- no change | |
with no_change as ( | |
select * from join_table | |
where temp_id is not null and data_id is not null | |
) | |
-- set is_deleted to true, username to modifier for deleted data | |
update temp set username = 'Kevin' | |
where id in (select temp_id from no_change); | |
-- see which data is unchanged | |
with no_change as ( | |
select * from join_table | |
where temp_id is not null and data_id is not null | |
) select temp_id, temp_c0, temp_username, temp_version from no_change; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment