mysql事务。事务默认是自动提交的。
START TRANSACTION; -- DML here ROLLBACK;
mysql临时表
CREATE TEMPORARY TABLE tmp_table SELECT *FROM emax_base.`tax_user_sign` WHERE merchant_id=1576834320215107; -- select * from tmp_table UPDATE tmp_table SET merchant_id=1576647918146389, create_time='2020-7-28 15:00:00',tax_sign_status='FAILED'; INSERT emax_base.`tax_user_sign` SELECT * FROM tmp_table;
mysql select语句中显示行的自增序号
SELECT (@i:=@i+1) AS rownum, a.entName ,a.orderId FROM `t_business_airorders202007` a,(SELECT @i:=0) AS it
mysql关联更新update
update tmp_table2 a join tmp_table1 b ON a.rownum=b.rownum join t_business_airorders202008 c on a.orderId=c.orderId set c.entName=b.entName;
(事务是用来做数据控制的,所以只针对DML(数据操控,增/删/改)起作用。建表和删除表属于DDL(数据定义),超出事务的范畴,所以事务对DDL不起作用。 )