I have a usecase where I need to copy value from a CustomPropertyX from EndpointA to CustomPropertyX on EndpointB, only when CustomPropertyX on EndpointB is empty or NULL.
Can someone please provide update query to set custom property based on above use case? I am planning to run this periodically in a custom query.
Could you please check if the below query will solve the purpose?
customproperty1 = (SELECT
endpointname = 'EndpointA')
endpointname = 'EndpointB'
AND (customproperty1 IS NULL
OR customproperty1 = '');
I should have been more clearer. When I was referring to EndPointA, it is actually the account custompropertyX.
if user has two Accounts A, B and I need CustompropertyX from Account A to be updated to CustomPropertyX on Account B.
UPDATE accounts a1 join endpoints e1 on e1.endpointkey=a1.endpointkey join user_accounts ua1 on ua1.accountkey=a1.accountkey SET
a1.customproperty1 = (SELECT a2.customproperty1 FROM endpoints e2,accounts a2,user_accounts ua2 WHERE e2.endpointname = 'EndpointB' and e2.endpointkey=a2.endpointkey and u2.userkey=a1.userkey)WHERE e1.endpointname = 'EndpointA'