mysql查表中有多少字段的sql语句

查出有多少数就行了,是count吗?应该规范怎么写?
2025-05-12 09:33:33
推荐回答(1个)
回答1:

select count(*) from information_schema.COLUMNS where TABLE_SCHEMA='test' and table_name='ceshi'

'test' 那个是库名,你替换一下
'ceshi'那个是表名,你也替换你想查找的表名