Tuesday, February 20, 2024

Upper and Lower functions in sql to change case of a string

 SELECT
FirstName,
LastName,
Address,
FirstName ||' '|| LastName || ' ' || Address ||','|| City ||' '||State ||' '||PostalCode as [Mailing Address],
length(PostalCode),
substr(PostalCode,1,5) as [5 digit postal code],
upper(FirstName) as [First Name all caps],
lower(LastName) as [Last Name all lower]
from Customer
where
country='USA'

No comments:

Post a Comment