Re: making lower case then first char to upper case?

2004-07-02 Thread Thomas Spahni
On Wed, 30 Jun 2004, Aaron Wolski wrote:

 Hi Guys,

 I'm trying to figure out of this is possible. I know I could do it in
 PHP but I am dealing with a ton of records and would rather put the
 processing on the DB than PHP/client side.

 Question is. can I do a SELECT query on a column that changes all the
 results to lower case and THEN changes the first character of each
 result to an upper case?

 Example:

 Currently in DB: AARON
 to Lowercase: aaron
 to Uppercase: Aaron


 Any idea on if I can do this and how I might approach it?

what about:

SELECT CONCAT( UPPER( LEFT(field,1) ),
LOWER( SUBSTRING(field,2) ) ) AS Something FROM ...

Thomas Spahni


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



making lower case then first char to upper case?

2004-06-30 Thread Aaron Wolski
Hi Guys,
 
I'm trying to figure out of this is possible. I know I could do it in
PHP but I am dealing with a ton of records and would rather put the
processing on the DB than PHP/client side.
 
Question is. can I do a SELECT query on a column that changes all the
results to lower case and THEN changes the first character of each
result to an upper case?
 
Example:
 
Currently in DB: AARON
to Lowercase: aaron
to Uppercase: Aaron
 
 
Any idea on if I can do this and how I might approach it?
 
Thanks so much
 
Aaron
 


Re: making lower case then first char to upper case?

2004-06-30 Thread Wesley Furgiuele
Someone else hopefully has something more efficient:
UPDATE table SET field = CONCAT( UPPER( LEFT( field, 1 ) ), LOWER( 
SUBSTRING( field, 2 ) ) )

Wes
On Jun 30, 2004, at 12:46 PM, Aaron Wolski wrote:
Hi Guys,
I'm trying to figure out of this is possible. I know I could do it in
PHP but I am dealing with a ton of records and would rather put the
processing on the DB than PHP/client side.
Question is. can I do a SELECT query on a column that changes all the
results to lower case and THEN changes the first character of each
result to an upper case?
Example:
Currently in DB: AARON
to Lowercase: aaron
to Uppercase: Aaron
Any idea on if I can do this and how I might approach it?
Thanks so much
Aaron

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


AW: making lower case then first char to upper case?

2004-06-30 Thread Freddie Sorensen
Aaron,

How about something like :

SELECT CONCAT(UCASE(LEFT(FieldName, 1)),
LCASE(RIGHT(FieldName,LENGTH(FieldName)-1)))

Right out of my head, I didn't count all the parantheses :-)

Freddie

 -Ursprüngliche Nachricht-
 Von: Aaron Wolski [mailto:[EMAIL PROTECTED] 
 Gesendet: Mittwoch, 30. Juni 2004 18:46
 An: [EMAIL PROTECTED]
 Betreff: making lower case then first char to upper case?
 
 Hi Guys,
  
 I'm trying to figure out of this is possible. I know I could 
 do it in PHP but I am dealing with a ton of records and would 
 rather put the processing on the DB than PHP/client side.
  
 Question is. can I do a SELECT query on a column that changes 
 all the results to lower case and THEN changes the first 
 character of each result to an upper case?
  
 Example:
  
 Currently in DB: AARON
 to Lowercase: aaron
 to Uppercase: Aaron
  
  
 Any idea on if I can do this and how I might approach it?
  
 Thanks so much
  
 Aaron
  
 



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