in reply to Getting length of longest value in a column
Get the DB to tell you the maximum length of the field. Assuming a well-trimmed varchar field called 'reason':
select max( len( reason ) ) from table;
If the field is fixed length or can having space padding, then you'd need to trim them up. The functions for that tend to vary from DB to DB.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Getting length of longest value in a column
by GrandFather (Saint) on Feb 20, 2012 at 20:52 UTC |