Created
April 8, 2014 02:46
-
-
Save sqlparser/10085055 to your computer and use it in GitHub Desktop.
Insert subquery indent
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
INSERT TOP (10) INTO HumanResources.NewEmployee | |
SELECT | |
e.BusinessEntityID, c.LastName, c.FirstName, pp.PhoneNumber, | |
a.AddressLine1, a.City, sp.StateProvinceCode, | |
a.PostalCode, e.CurrentFlag | |
FROM HumanResources.Employee e | |
INNER JOIN Person.BusinessEntityAddress AS bea | |
ON e.BusinessEntityID = bea.BusinessEntityID | |
INNER JOIN Person.Address AS a | |
ON bea.AddressID = a.AddressID | |
INNER JOIN Person.PersonPhone AS pp | |
ON e.BusinessEntityID = pp.BusinessEntityID | |
INNER JOIN Person.StateProvince AS sp | |
ON a.StateProvinceID = sp.StateProvinceID | |
INNER JOIN Person.Person as c | |
ON e.BusinessEntityID = c.BusinessEntityID; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment