Advertisement
chrissharp123

Untitled

Oct 19th, 2018
431
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. begin;
  2. create table csharp.payments_with_dupe_ids as select id, count(*) from money.payment group by 1 having count(*) > 1;
  3. create table csharp.backup_payments_with_dupe_ids as select * from money.payment_view where id in (select id from csharp.payments_with_dupe_ids);
  4. update money.payment set id = default where id in (select id from csharp.payments_with_dupe_ids );
  5. commit;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement