MySQL Determine longest VarChar length

前端 未结 4 1632
情话喂你
情话喂你 2021-02-08 23:05

I am trying to optimize my database. In order to do so, I need to be able to determine the longest data entry in a varchar column, and then trim the column definition to just a

4条回答
  •  误落风尘
    2021-02-08 23:50

    If you want to know the max length of the field output, for example, you can use this query:

    SELECT Max(CHAR_LENGTH(`output`)) AS Max FROM `poller_output`
    

提交回复
热议问题