Showing posts with label Truncating strings using substr function in sql. Show all posts
Showing posts with label Truncating strings using substr function in sql. Show all posts

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'