1
0

mysql事务问题演示

This commit is contained in:
2025-09-01 04:31:37 +08:00
parent 484bd7eb02
commit 71c569c9bd
3 changed files with 76 additions and 0 deletions

View File

@@ -0,0 +1,20 @@
-- example 1
-- ========== 1 =========
start transaction;
-- B插入数据
insert into customer (id, username)
values (1, 'Fortern'),
(2, 'Maxin'),
(3, 'MooGeo');
commit;
-- ========== 2 =========
-- example 2
-- ========== 1 =========
start transaction;
-- B 修改所有人的name
update customer set username = '哈基米' where true;
commit;
-- ========== 2 =========