数据库中的表数

时间:2014-04-16 08:20:29

标签: sql rdbms

  

如何计算数据库中的表数?

SELECT COUNT *    
FROM SHOW TABLES AS A

2 个答案:

答案 0 :(得分:4)

 SELECT COUNT(*) FROM information_schema.tables WHERE table_schema = 'dbName';

Source

这个很容易

USE databasename; SHOW TABLES; SELECT FOUND_ROWS();

答案 1 :(得分:3)

SELECT COUNT(*) FROM information_schema.tables WHERE table_schema = 'dbName';