You know, this works just fine for me -- when you say it is NOT working, what do you mean exactly? Are you getting an error? Or results that you don't expect?
Bill Tantzen University of Minnesota Libraries [EMAIL PROTECTED] 612-626-9949 (office) 612-250-6125 (cell) ________________________________________________________________ I guess the man's a genius, but what a dirty mind he has, hasn't he? -- Nora Joyce > -----Original Message----- > From: spacemarc [mailto:[EMAIL PROTECTED] > Sent: Wednesday, September 06, 2006 9:46 AM > To: Miles Thompson > Cc: mysql@lists.mysql.com > Subject: Re: SELECT counting chars with LEFT() > > 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] > > -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe: http://lists.mysql.com/[EMAIL PROTECTED]