Find the length of the longest row in a column in oracle

后端 未结 9 1549
野趣味
野趣味 2020-12-16 14:19

Does anybody know if there is a way to find what the length of the longest row in a column in Oracle?

Basically I need to get the length of the longest row and then

9条回答
  •  心在旅途
    2020-12-16 14:44

    This should do what you want:

    select max(length(MyColumn)) from MyTable;
    

    Depending on what you are trying to achieve, you may also be insterested to know that you can output the data in the column plus exactly one space like this:

    select rtrim(MyColumn)||' ' from MyTable;
    

提交回复
热议问题