mysql 查字段数量

SELECT table_name, COUNT(column_name) AS column_count
FROM information_schema.columns
WHERE table_schema = 'your_database_name'
GROUP BY table_name;
字段数量
SELECT SUM(column_count) AS total_column_count
FROM (
  SELECT table_name, COUNT(column_name) AS column_count
  FROM information_schema.columns
  WHERE table_schema = 'your_database_name'
  GROUP BY table_name
) AS subquery;
 字段数量求和

表数量

SELECT COUNT(*) AS table_count
FROM information_schema.tables
WHERE table_schema = 'your_database_name';
发布日期:
分类:未分类

发表评论

您的电子邮箱地址不会被公开。 必填项已用*标注