計算指定欄位大小,並依據所屬條件顯示

mysql> select sum(row_size) 
from (
  select 
    char_length(RecipJson)
  as row_size 
  from tb_recipient_list where ID = 'GOKC123456789'
) as tbl1;
+---------------+
| sum(row_size) |
+---------------+
| 99638         |
+---------------+

意外發現… 使用Length 取出結果也相同…

mysql> select Email , LENGTH(RecipJson) from tb_recipient_list where ID = 'GOKC123456789';

+----------------+-------------------+
| ID             | LENGTH(RecipJson) |
+----------------+-------------------+
| GOKC123456789  |             99638 |
+----------------+-------------------+

 

Leave a Comment