Skip to content

Instantly share code, notes, and snippets.

@karenpayneoregon
Last active July 10, 2020 14:55
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save karenpayneoregon/55cfa05ac21809ffed6146089fd7649d to your computer and use it in GitHub Desktop.
Save karenpayneoregon/55cfa05ac21809ffed6146089fd7649d to your computer and use it in GitHub Desktop.
Using NorthWind2020 select customers
SELECT Cust.CustomerIdentifier,
Cust.CompanyName,
Cust.ContactId,
CT.ContactTitle,
C.FirstName,
C.LastName,
Cust.Street,
Cust.City,
Cust.Region,
Cust.PostalCode,
Countries.[Name] AS CountryName,
Cust.CountryIdentifier,
Cust.Phone,
Cust.Fax,
Cust.ContactTypeIdentifier,
Cust.ModifiedDate
FROM Customers AS Cust
INNER JOIN Contacts AS C ON Cust.ContactId = C.ContactId
INNER JOIN ContactType AS CT ON Cust.ContactTypeIdentifier = CT.ContactTypeIdentifier
INNER JOIN Countries ON Cust.CountryIdentifier = Countries.CountryIdentifier;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment