use
information_schema
select
table_name,table_rows
from
tables
where
TABLE_SCHEMA
=
'数据库名'
order
by
table_rows
desc
1、MySQL 更新或插入后获取受影响行数,用下面函数可以获取:
SELECT ROW_COUNT()
2、Mysql的select语句得到的行数:
select count(1) from index_scoreinfo
用count(*)函数来统计,返回匹配指定条件的行数。
例如有个表名称为demos,那么统计行数可以写:select count(*) from demos;
后面可以加限制条件,例如统计val大于3的记录行数:select count(*) from demos where val>3
扩展资料:
MySQL COUNT(*)
The COUNT(*) function returns the number of rows in a result set returned by a SELECT statement. TheCOUNT(*) function counts rows that contain no-NULL and NULL values.
COUNT(*) 语法
SELECT COUNT(*) FROM table_name
参考资料:MySQL官网-MySQL COUNT
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)