October 24, 2024
Chicago 12, Melborne City, USA
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

Leave feedback about this

  • Quality
  • Price
  • Service

PROS

+
Add Field

CONS

+
Add Field
Choose Image
Choose Video