max(length(field)) in mysql

前端 未结 9 600
南方客
南方客 2021-01-30 06:25

If I say:

select max(length(Name)) 
  from my_table

I get the result as 18, but I want the concerned data also. So if I say:

s         


        
9条回答
  •  星月不相逢
    2021-01-30 06:47

    Select URColumnName From URTableName Where length(URColumnName ) IN 
    (Select max(length(URColumnName)) From URTableName);
    

    This will give you the records in that particular column which has the maximum length.

提交回复
热议问题