max(length(field)) in mysql

前端 未结 9 599
南方客
南方客 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:57

    Ok, I am not sure what are you using(MySQL, SLQ Server, Oracle, MS Access..) But you can try the code below. It work in W3School example DB. Here try this:

    SELECT city, max(length(city)) FROM Customers;
    

提交回复
热议问题