MySQL语法备忘

1、事务

START TRANSACTION;
......
COMMIT;/ROLLBACK;

2、关联表的更新

UPDATE a,b SET a.updated_time = NOW() , a.b_id = b.id
WHERE a.name = 'a1' AND b.name = 'b1';

 

你可能感兴趣的:(数据库)