Sometimes we need to get the primary details of a customer. Below SQL query provides the primary email information of the customer. Depending on contact type, we can get the details. If we comment the type condition, query will return all the primary contact information.
1 2 3 4 5 6 7 8 9 10 11 12 | select LogisticsElectronicAddress.locator, LogisticsElectronicAddress.TYPE,LogisticsElectronicAddress.ISPRIMARY,* from custtableJOIN DirPartyLocationON dirPartyLocation.party = custtable.PartyJOIN LogisticsElectronicAddressON LogisticsElectronicAddress.Location = dirPartyLocation.LocationAND LogisticsElectronicAddress.Type = 2AND LogisticsElectronicAddress.ISPRIMARY = 1JOIN LogisticsElectronicAddressRoleON LogisticsElectronicAddressRole.ElectronicAddress =LogisticsElectronicAddress.RecIdjoin LogisticsLocationRoleON LogisticsLocationRole.RecId = LogisticsElectronicAddressRole.LocationRolewhere custtable.AccountNum = "CustAccount" |
No comments:
Post a Comment