2006/9/6, Miles Thompson <[EMAIL PROTECTED]>:
First of all - please reply to the list ..

I thought you wanted all fields, that's the way your SELECT statement is
constructed. If just the first 20 char from fieldA, then ...
         SELECT LEFT(fieldA, 20) AS fieldA FROM Tab1
should do what you want. Again, check the syntax for LEFT() in the MySQL docs.

the syntax is valid:
from http://dev.mysql.com/doc/refman/5.0/en/string-functions.html:
"LEFT(str,len) returns the leftmost len characters from the string
str, or NULL if any argument is NULL."
mysql> SELECT LEFT('foobarbar', 5);
       -> 'fooba'

I have 30 fields: instead writing all 30 fields, I would want to
select them all with * and only for one of they, fieldA, to obtain the
first 20 chars: it's possible?


--
http://www.spacemarc.it

--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:    http://lists.mysql.com/[EMAIL PROTECTED]

Reply via email to