ownheart
一句话,row_count() 函数一般用于返回被 update, insert, delete 实际修改的行数。
In MySQL 5.6, ROW_COUNT() returns a value as follows:
DDL statements: 0. This applies to statements such as CREATE TABLE or DROP TABLE.
DML statements other than SELECT: The number of affected rows. This applies to statements such as UPDATE, INSERT, or DELETE (as before), but now also to statements such as ALTER TABLE and LOAD DATA INFILE.
SELECT: -1 if the statement returns a result set, or the number of rows “affected” if it does not. For example, for SELECT * FROM t1, ROW_COUNT() returns -1. For SELECT * FROM t1 INTO OUTFILE 'file_name', ROW_COUNT() returns the number of rows written to the file.
SIGNAL statements: 0.