Tuesday, February 20, 2024

Truncating strings using substr function in sql

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

No comments:

Post a Comment