mysql事务

1 开始事务begin;

2 提交事务commit;

3 回滚(撤销)事务rollback;

4 代码

sql 复制代码
update student set userName='流氓+渣男' where id=5;
begin;
update student set userName='流氓da渣男' where id=5;
select * from student where id=5;
update student set userName='独臂大傻雕渣男' where id=4;
select * from student where id=4;
rollback;
commit;

5 效果图

相关推荐
sqyno1sky24 分钟前
数据分析与科学计算
jvm·数据库·python
gjc5921 小时前
如何写好SQL:企业内训文档
数据库·sql
liulilittle1 小时前
SQLite3增删改查(C
c语言·开发语言·数据库·c++·sqlite
Astro_ChaoXu1 小时前
GAMSE使用日志与教程(高分辨率光谱数据缩减)
linux·数据库·python
新缸中之脑1 小时前
Google TurboQuant 详解
数据库·redis·缓存
yoyo_zzm2 小时前
MySQL数据库误删恢复_mysql 数据 误删
数据库·mysql·adb
F1FJJ2 小时前
Shield CLI 的 PostgreSQL 插件 v0.5.0 发布:数据库导出 + 协作增强,ER 图全新体验
网络·数据库·docker·postgresql·go
weixin199701080163 小时前
《深入浅出:图解淘宝分布式数据库TDDL(及开源替代方案)》
数据库·分布式·开源
数据库小组3 小时前
Oracle 上云 / 替代场景下,NineData 完成到 PostgreSQL 的低风险迁移
大数据·数据库·mysql·postgresql·oracle·数据一致性·数据库迁移
Ricky_Theseus3 小时前
SQL Server 2008 四种排序函数
数据库