SQL column length query

Posted by Mike on Stack Overflow See other posts from Stack Overflow or by Mike
Published on 2010-03-15T14:52:49Z Indexed on 2010/03/15 14:59 UTC
Read the original article Hit count: 275

Filed under:
|

i've been using the following query:

select LEN(columnname) as columnmame 
  from dbo.amu_datastaging

This works, but is there a way to only return the greatest value instead of all the values?

So if i return 1million records and the longest length is 400, the query would just return the value of 400?

© Stack Overflow or respective owner

Related posts about sql

Related posts about sql-server