【发布时间】:2012-12-09 01:38:17
【问题描述】:
【问题讨论】:
【问题讨论】:
此类信息位于INFORMATION_SCHEMA中,您可以查询名为COLUMNS 的表以获取数据库中的列数。
此查询将为您提供列数。
SELECT COUNT(*) FROM INFORMATION_SCHEMA.COLUMNS
WHERE table_schema = 'DB_NAME' AND table_name = 'TABLE_NAME'
【讨论】:
select COUNT(*) totalColumns
from information_schema.columns
where table_schema = 'db_2_a3c3e' AND -- the name of your Database
table_name = 'table1' -- the name of your table
【讨论】: