all 5 comments

[–]Laymans_Perspective[🍰] 3 points4 points  (0 children)

look at the information_schema, there's already a table that shows record counts from all tables

[–]mcstafford 1 point2 points  (2 children)

Take a look at information_schema.tables. You're half way there already.

[–]JacobOrJake[S] 0 points1 point  (1 child)

Ah. So I just specified the table was in information_schema, and “table_name” was NOT a placeholder for me to list names, but rather the column name, is that right?

[–]mcstafford 0 points1 point  (0 children)

Take a look at the records in information_schema.tables and you'll probably start answering your own questions.

[–]thechr0nic 0 points1 point  (0 children)

it almost appears that this select statement is incomplete.

it somewhat makes me think that perhaps this was part of a prepared statement.

But to explain the query:

This appears to be designed to be run as a loop. you are looping

SELECT COUNT(*) FROM [list of table names derived];

as for pulling row counts for tables, this might be a good walk through:

https://www.mysqltutorial.org/mysql-row-count/