Shaun,

The length can be any value between 1 and 255. (As of MySQL Version 3.23,
the length of CHAR may be 0 to 255.)  See
http://www.mysql.com/doc/en/CHAR.html

If you're looking to find the maximum length of the values in a particular
column, use something like this:

In table 'tablename' for column 'columnname'.....

mysql> select max(length(columnname)) from tablename;

+-------------------------+
| max(length(columnname)) |
+-------------------------+
|                      22 |
+-------------------------+

Cheers,

Andrew

-----Original Message-----
From: Shaun Bramley [mailto:[EMAIL PROTECTED]] 
Sent: Sunday, 22 September 2002 19:14
To: [EMAIL PROTECTED]
Subject: Database Query Question


Hi all,

I need to be able to tell what the maximum length of a char column is.  Can
I query the database for this information?


Shaun
list filter: mysql

---------------------------------------------------------------------
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/           (the list archive)

To request this thread, e-mail <[EMAIL PROTECTED]>
To unsubscribe, e-mail
<[EMAIL PROTECTED]>
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php

---------------------------------------------------------------------
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/           (the list archive)

To request this thread, e-mail <[EMAIL PROTECTED]>
To unsubscribe, e-mail <[EMAIL PROTECTED]>
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php

Reply via email to