查询一个表中有多少个字段

SELECT COUNT(*) FROM information_schema. COLUMNS WHERE table_schema = '数据库名' AND table_name = '表名';