Skip to content

Instantly share code, notes, and snippets.

@pierresetteskog
Last active August 29, 2015 14:06
Show Gist options
  • Save pierresetteskog/a182d249e19b7fcb47a9 to your computer and use it in GitHub Desktop.
Save pierresetteskog/a182d249e19b7fcb47a9 to your computer and use it in GitHub Desktop.
enova customer
SELECT EnovaCustomer.FirstName, EnovaCustomerAddress.Street, EnovaCustomerAddress.PostalAddress, EnovaCustomerAddress.PostalCode, EnovaCustomerAddress.City, EnovaCustomerAddress.State,
EnovaCustomerAddress.CountryName, EnovaCustomer.LastName, EnovaCustomer.SiteID, WebFoundationRole.ID AS RoleId, EnovaCustomerGroup.ID AS GroupId, WebFoundationRole.Name_lang1,
EnovaCustomerGroup.Name_lang1 AS Expr1, WebFoundationRole.Name_lang2, WebFoundationRole.Name_lang3, WebFoundationRole.Name_lang4, WebFoundationRole.Name_lang5,
EnovaCustomerGroup.Name_lang2 AS Expr2, EnovaCustomerGroup.Name_lang3 AS Expr3, EnovaCustomerGroup.Name_lang4 AS Expr4, EnovaCustomerGroup.Identifier,
WebFoundationRole.Identifier AS Expr5
FROM LinkUserToUserGroup LEFT OUTER JOIN
WebFoundationRole ON LinkUserToUserGroup.ID2 = WebFoundationRole.ID LEFT OUTER JOIN
EnovaCustomerGroup ON LinkUserToUserGroup.ID2 = EnovaCustomerGroup.ID RIGHT OUTER JOIN
EnovaCustomer ON LinkUserToUserGroup.ID1 = EnovaCustomer.ID LEFT OUTER JOIN
EnovaCustomerAddress ON EnovaCustomer.ID = EnovaCustomerAddress.AddressableID
WHERE (EnovaCustomer.Deleted = 0) AND (ISNULL(EnovaCustomerAddress.Deleted, 0) = 0) AND (ISNULL(EnovaCustomerGroup.Deleted, 0) = 0) AND (ISNULL(LinkUserToUserGroup.Deleted, 0) = 0) AND
(ISNULL(WebFoundationRole.Deleted, 0) = 0)
ORDER BY EnovaCustomer.ID, EnovaCustomerAddress.ID, GroupId, RoleId
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment