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. 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';" if you have more than one database with a rabbits table.
Hope this helps!
You can't SELECT that, try this instead:
SELECT Avg_row_length FROM information_schema.tables WHERE table_name='rabbits';
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With