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

如何查一个表有多少字段

WBOY
Release: 2016-06-13 11:10:04
Original
1937 people have browsed it

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


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


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

------解决方案--------------------
参考下帖
http://bbs.csdn.net/topics/320235486
Related labels:
source:php.cn
Statement of this Website
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template