mysql查询表的字段数

1.先查询表结构

desc user;

再统计行数即可

select found_rows();

2.通过查询information_schema表
select count(1) from information_schema.`COLUMNS` where TABLE_SCHEMA = "mysql" and TABLE_NAME="user";

猜你喜欢

转载自blog.csdn.net/man_to_home/article/details/54919894