小tips:列出mysql中指定表的列数

假如要得出mysl中某个表的列的个数,可以这样做,很简单:

SELECT COUNT(*) AS Columns
FROM INFORMATION_SCHEMA.COLUMNS
WHERE table_schema = 'database name'
AND table_name = 'table name'

猜你喜欢

转载自jackyrong.iteye.com/blog/1725250