Does Mysql have an equivalent to @@ROWCOUNT like in mssql?

后端 未结 5 1599
情深已故
情深已故 2020-11-27 05:05

How can I get row count values in MySQL as @@ROWCOUNT does in mssql?

5条回答
  •  半阙折子戏
    2020-11-27 06:01

    Count the number of rows in a sub-query in the where clause. Then test if the total number of rows is greater than zero.

    SELECT customerNumber, customerName, creditLimit FROM customers where (SELECT count(*) as tot FROM customers) > 0;

提交回复
热议问题