如何计算数据库中的表数?
SELECT COUNT *
FROM SHOW TABLES AS A
答案 0 :(得分:4)
SELECT COUNT(*) FROM information_schema.tables WHERE table_schema = 'dbName';
这个很容易
USE databasename; SHOW TABLES; SELECT FOUND_ROWS();
答案 1 :(得分:3)
SELECT COUNT(*) FROM information_schema.tables WHERE table_schema = 'dbName';