Actual length of VARCHAR filed

Database
Enthusiast

Actual length of VARCHAR filed

I have a column defined as VARCHAR. Some sample records loaded for this column. I have to findout what is maximum and minimum length for this filed for the loaded records.How can I do this?

Thanks in Advance
Sharath

2 REPLIES
Enthusiast

Re: Actual length of VARCHAR filed

SELECT MAX(CHARACTER_LENGTH(colname))
,MIN(CHARACTER_LENGTH(colname))
FROM tablename;
Enthusiast

Re: Actual length of VARCHAR filed

Thanks Barry. It's working fine.