سؤال

I am using 'show tables' to get the names of tables from MySQL. I would like to know if its possible to have one query that would display only tables that have more than '100' records.

هل كانت مفيدة؟

المحلول

What you need is in the INFORMATION_SCHEMA.TABLES

SELECT TABLE_NAME,TABLE_ROWS
FROM INFORMATION_SCHEMA.TABLES 
WHERE TABLE_SCHEMA = 'YOUR DB NAME' AND
      TABLE_ROWS > 100
مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top