mysql在字段量特别大情况下 如何获取数据库中的字段数量
SELECT
COUNT(*)
FROM
information_schema. COLUMNS
WHERE
TABLE_SCHEMA = ‘数据库名’
AND table_name = ‘表名’;
比如以下
SELECT
COUNT(*)
FROM
information_schema. COLUMNS
WHERE
TABLE_SCHEMA = ‘portal’
AND table_name = ‘user_info’;
portal为数据库名称
user_info为表名称