Skip to content

Instantly share code, notes, and snippets.

@crabcrabcam
Created December 13, 2016 10:00
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 crabcrabcam/2ced4fa18049037a7d15dd49a7982f44 to your computer and use it in GitHub Desktop.
Save crabcrabcam/2ced4fa18049037a7d15dd49a7982f44 to your computer and use it in GitHub Desktop.
Gets regions by ID and all that
-- Define the database to use
USE ExSQL7
-- Gets all the parts I want and joins them together and links them.
SELECT Region.RegionID, Territories.TerritoryID, Region.RegionDescription, Territories.TerritoryDescription FROM Region
INNER JOIN Territories
ON Territories.RegionID = Region.RegionID
ORDER BY RegionDescription, TerritoryDescription
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment