如何获取mysql中记录的大小 [英] how to get the size of a record in mysql

查看:149
本文介绍了如何获取mysql中记录的大小的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如果表包含TEXT或BLOB类型的字段,如何获取MySql中记录的大小?

How to get the size of a record in MySql if the table contains fields of type TEXT or BLOB?

是否可以使用sql语句获取记录或表的大小?

is it possible to get the size of a record or table using sql statement?

推荐答案

要计算字符串或blob的大小(以字节为单位),请使用

To calculate the size of a string or blob in bytes, use LENGTH(YourColumn).

要计算文本字符串中的字符数,请使用 CHAR_LENGTH(YourTextColumn) .

To calculate the number of characters in a text string, use CHAR_LENGTH(YourTextColumn).

这篇关于如何获取mysql中记录的大小的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆