MySQL Determine longest VarChar length

前端 未结 4 1633
情话喂你
情话喂你 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:31

    The back ticks and the char_length function in Aurelio's answer both cause errors. This answer works.

提交回复
热议问题