Advertisement
Guest User

Untitled

a guest
Oct 25th, 2016
57
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
T-SQL 0.44 KB | None | 0 0
  1. SELECT p.BusinessEntityID, p.FirstName, p.MiddleName, p.LastName, CONCAT(a.AddressLine1, ' ', a.AddressLine2), a.City, cr.Name, p.PersonType
  2. FROM Person.Person p
  3. JOIN Person.BusinessEntityAddress bea
  4. ON bea.BusinessEntityID=p.BusinessEntityID
  5. JOIN Person.Address a
  6. ON a.AddressID=bea.AddressID
  7. JOIN Person.StateProvince sp
  8. ON a.StateProvinceID=sp.StateProvinceID
  9. JOIN Person.CountryRegion cr
  10. ON cr.CountryRegionCode=sp.CountryRegionCode;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement