Home  >  Article  >  Backend Development  >  如何查一个表有多少字段

如何查一个表有多少字段

WBOY
WBOYOriginal
2016-06-13 11:10:041904browse

怎么查一个表有多少字段
表的字段太多,怎么用sql看有多少字段呢,,字段太多会不会影响效率呢


------解决方案--------------------
引用:
desc tablebame


desc tablename
------解决方案--------------------
看下返回多少条记录也就能知道有多少个字段了
当然 也可以查询 information_schema 数据库
 SELECT count(*) FROM COLUMNS WHERE table_name='table_name' 

------解决方案--------------------
参考下帖
http://bbs.csdn.net/topics/320235486
Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn