start TRANSACTION;
update test_table set total=total+1 WHERE id=1;
IF ROW_COUNT() = 1 THEN
ROLLBACK;
ELSE
COMMIT;
END IF;
请问这错在哪啊 我用set @total=ROW_COUNT(); if @total>0 then来判断也不行,要怎么写
start TRANSACTION
OK
时间: 0.037s
update test_table set total=total+1 WHERE id=1
Affected rows: 1
时间: 0.022s
IF ROW_COUNT() = 1 THEN
ROLLBACK
1064 - You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'IF ROW_COUNT() = 1 THEN
ROLLBACK' at line 1
时间: 0s