SELECT table_name,table_rows,data_length+index_length,
CONCAT(ROUND((data_length+index_length)/1024/1024,2),'MB')
DATA FROM information_schema.tables WHERE table_schema='compute_model'
AND table_name='employees';

本文介绍了一种使用SQL查询特定数据库表的技巧,展示了如何从'compute_model'数据库的'employees'表中选择表名、行数及数据长度,并将数据长度转换为MB单位进行展示。
SELECT table_name,table_rows,data_length+index_length,
CONCAT(ROUND((data_length+index_length)/1024/1024,2),'MB')
DATA FROM information_schema.tables WHERE table_schema='compute_model'
AND table_name='employees';

573
1万+

被折叠的 条评论
为什么被折叠?