3 ms·
Why do you need to use a transaction for that? Do the update statement, followed by insert-where-not-exists. If the update doesn't match, 0 rows updated, and t
by NoMoreNicksLeft 12y ago
Why do you need to use a transaction for that?
Do the update statement, followed by insert-where-not-exists. If the update doesn't match, 0 rows updated, and the insert works. If the update matches, then 0 rows inserted.
- anarazel 12y agoThat's unfortunately not correct. The WHERE NOT EXISTS(...) will not "see" rows inserted by concurrently running transactions that have not committed yet.