Mixed Case

Database
Enthusiast

Mixed Case

How do I return mixed case from characters stored in upper case?

Example

SELECT customer_name
FROM customer

Returns -
BILL SMITH
ALEX SMITH

I want to format as
Bill Smith
Alex Smith

Thanks,

Joe
2 REPLIES
Enthusiast

Re: Mixed Case

If you are looking for an easy way ( using teradata function), I am not aware of .. however, you can manipulate the string using the following sample. You may not require the UPPER functions if your data always looks like the way you mentioned.

select UPPER(SUBSTRING ( customer_name From 1 for 1))|| Lower( Substring ( customer_name From 2 for position(' ' IN customer_name)-1 ))
|| ' '||UPPER(SUBSTRING ( customer_name FROM POSITION (' ' IN customer_name) +1,1))
||Lower ( SUBSTRING ( customer_name FROM POSITION (' ' IN customer_name) +2) )
from Customer
Enthusiast

Re: Mixed Case

That is what I was affraid of. Thanks for the info!!