OiO.lk Blog SQL Output any table in a database that has rows using SQL
SQL

Output any table in a database that has rows using SQL


I want to be able to output any table that has a rowcount > 0 in SQL database. So in other words if the database has 100 tables I want to be able to know which tables have rows

I have tried the following:

 SELECT table_name
 FROM information_schema.tables
 WHERE table_schema="your_database_name" 
 AND table_rows > 0;

But it says table_rows is an invalid column
How can I do this?



You need to sign in to view this answers

Exit mobile version