Guest User

Untitled

a guest
Apr 25th, 2018
73
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.37 KB | None | 0 0
  1. left join ZIPCODETABLE ta on ta.Zip like '%co.Zip%'
  2.  
  3. left join ZIPCODETABLE ta on ta.Zip = co.Zip
  4. where ta.Zip LIKE '_%-'
  5.  
  6. set zipcode = left(zipcode, 5)
  7. where right(ltrim(rtrim(zipcode)),1) = '-'
  8.  
  9. select
  10. c.email
  11. , c.firstName
  12. , c.zip
  13. , left(ta.zip,5) as zipMatch
  14. , ta.zip as zipFullMatch
  15. from CustomerDE c
  16. left join ZIPCODETABLE ta on (left(ta.Zip,5) = left(c.zip,5))
Add Comment
Please, Sign In to add comment