We have a MySQL database containing contact information for our customers. I was asked to query the database for all contacts for a specific salesman "GGS". (The query is below) The problem I am having is that many facilities have multiple contacts. I have to include the phone number "BusinessPhone" but our system is a little weird on how it saves the data. It seems if there is only 1 contact number saved under BusinessPhone then it only saves the phone number for the first contact but leave the fields blank for all other contacts for that faciltiy. (So if Joe, Sally and John are all contacts with the phone number 555-5555, Joe has the number listed in the database but John and Sally do not) So I need to find a way to replicate the BusinessPhone field to any other contacts for the same facility with no entery. This is for output purposes only, not an update of the database.
FROM arcconts T
Left Outer Join arcusts T1 On T.CustID = T1.CustID
Left Outer Join arsmen T2 On T1.SmanID = T2.SmanID
Where T2.SmanCode = 'GGS'
and T.FirstName <> 'OrderConfirmContact'