Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- left join ZIPCODETABLE ta on ta.Zip like '%co.Zip%'
- left join ZIPCODETABLE ta on ta.Zip = co.Zip
- where ta.Zip LIKE '_%-'
- set zipcode = left(zipcode, 5)
- where right(ltrim(rtrim(zipcode)),1) = '-'
- select
- c.email
- , c.firstName
- , c.zip
- , left(ta.zip,5) as zipMatch
- , ta.zip as zipFullMatch
- from CustomerDE c
- left join ZIPCODETABLE ta on (left(ta.Zip,5) = left(c.zip,5))
Add Comment
Please, Sign In to add comment