本文介绍了MySQL-查询平均行长的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一张叫兔子的桌子.我正在尝试在表中找到平均行长.我尝试了以下查询:

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)

但是它不起作用.

推荐答案

我的Google搜索表明AVG_ROW_LENGTH实际上是information_schema.tables中的一列.我想,您将想尝试类似的方法:

My Googling has indicated that AVG_ROW_LENGTH is actually a column in 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';

您可能还需要通过添加"AND TABLE_SCHEMA ='databasename';"来指定数据库名称.如果您有多个数据库和一个Rabbits表.

You may also need to specify the database name by adding "AND TABLE_SCHEMA = 'databasename';" if you have more than one database with a rabbits table.

希望这会有所帮助!

这篇关于MySQL-查询平均行长的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

10-20 22:47