FOUND_ROWS()

Overview

Returns the number of rows found by the most recent successful SELECT statement.

USAGE

FOUND_ROWS()

DETAILS

FOUND_ROWS() is an information function that returns the number of rows found by the most recent successful SELECT statement even if a LIMIT clause did not return all of the row contents.

If the prior SELECT had a LIMIT clause, it must also have included the SQL_CALC_FOUND_ROWS modifier for the return value of FOUND_ROWS() to be correct.

SYNONYMS

SCHEMA

PARAMETERS

SKYSQL

PRIVILEGES

EXAMPLES

CREATE table found_rows_example (a INT);
INSERT INTO found_rows_example VALUES (1), (2), (3);
SELECT SQL_CALC_FOUND_ROWS *
  FROM found_rows_example
  LIMIT 1;
+------+
| a    |
+------+
|    1 |
+------+
SELECT FOUND_ROWS();
+--------------+
| FOUND_ROWS() |
+--------------+
|            3 |
+--------------+

ERROR HANDLING

FEATURE INTERACTION

RESPONSES

DIAGNOSIS

ISO 9075:2016

CHANGE HISTORY

Release Series

History

23.09

  • Present starting in MariaDB Xpand 23.09.1.

6.1

  • Present starting in MariaDB Xpand 6.1.0.

6.0

  • Present starting in MariaDB Xpand 6.0.3.

5.3

  • Present starting in MariaDB Xpand 5.3.13.

Release Series

History

6.0

  • Present starting in MariaDB Xpand 6.0.3.

5.3

  • Present starting in MariaDB Xpand 5.3.13.

Release Series

History

6.1

  • Present starting in MariaDB Xpand 6.1.0.

EXTERNAL REFERENCES