Issue:
There may be issues that require editing or updating Master Account information for a customer. The script below will return the IDs based on the customer number entered.
Resolution:
Use the Customer Number linked to the Master to get the information.
Additional fields can be added to the select if needed. This will return the Master Account and the Site for the Master Account.
select c.Customer_Number,ma.Master_Account_Id,* from AR_Customer_Site s
inner join ar_customer c on c.Customer_Id =s.Customer_Id
inner join AR_Master_Account ma on ma.Customer_Id =s.Customer_Id
where c.customer_number ='My Master'