简体   繁体   English

MySQL - 查询平均行长度

[英]MySQL - querying average row length

I have a table named rabbits. 我有一张名为兔子的桌子。 I am trying to find the average row length in my table. 我试图在我的表中找到平均行长度。 I tried this query: 我试过这个查询:

SELECT AVG_ROW_LENGTH(rabbits)

but it doesn't work. 但它不起作用。

My Googling has indicated that AVG_ROW_LENGTH is actually a column in information_schema.tables. 我的谷歌搜索表明AVG_ROW_LENGTH实际上是information_schema.tables中的一列。 You'll want to try something like this, I think: 你想尝试这样的东西,我想:

SELECT AVG_ROW_LENGTH FROM information_schema.tables WHERE TABLE_NAME = 'rabbits';

You may also need to specify the database name by adding "AND TABLE_SCHEMA = 'databasename';" 您可能还需要通过添加“AND TABLE_SCHEMA ='databasename';”来指定数据库名称。 if you have more than one database with a rabbits table. 如果你有一个兔子表的数据库。

Hope this helps! 希望这可以帮助!

你不能选择它,试试这个:

SELECT Avg_row_length FROM information_schema.tables WHERE table_name='rabbits';

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM