Skip to content

Commit

Permalink
Batch Bulk Update
Browse files Browse the repository at this point in the history
  • Loading branch information
nobuenhombre committed May 7, 2023
1 parent 040774c commit fc46e64
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions code/build/postgresql/batch-bulk-update.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
UPDATE
users
SET
full_name = data.name,
email = data.email
FROM
(VALUES
('two', 'Natan', '[email protected]'),
('three', 'Nostra', '[email protected]'),
('sum', 'Zorg', '[email protected]')
) AS data (id, name, email)
WHERE
users.username = data.id;

0 comments on commit fc46e64

Please sign in to comment.