mysql 查询语句

查询库下面的表的文件大小已mysql库为例
select
TABLE_NAME,
concat(truncate(data_length/1024/1024,2),' MB') as data_size,
concat(truncate(index_length/1024/1024,2),' MB') as index_size
from information_schema.tables
where TABLE_SCHEMA = 'mysql'
group by TABLE_NAME
order by data_length desc;

统计mysql 重复数据已name字段为例
select name ,count() as count from zipkin_spans group by name having count >1;统计mysql表的数据总数select count() from zipkin_spans;

相关文章
相关标签/搜索