I do not know what your * in your select query is referring to, so I cannot give you a complete answer to this. I do not know if the way I am about to suggest is the most efficient way to handle this.
But assuming you do not have the * in the select query (you do not want any more fields) then the following may be a start of what you are looking for (but will not work as it is):
-
SELECT T1.TaxID,
-
IF (T1.ECC='yes',T2.CPTcode,T3.CPTcode) as CPTcode,
-
IF (T1.ECC='yes',T2.Charge,T3.Charge) as Charge
-
FROM T_Physicians T1, T_ECCcpt T2, T_SibleyCpt T3
-
WHERE (missing join conditions here)
-
AND (((T1.TaxID)="58-229xxxx"))
-
Here I do not know what the actual name of the attribute is in your main table for this ECC flag, nor do I know what values it can have. In the above example, I call it ECC, and I assume it has the value of 'yes' or 'no'. You can make changes to the above to fit your situation.
Also notice that I introduce here the aliases T1, T2 and T3 to make life simpler.
What is obviously missing here are missing join conditions for the three tables, and whether this strategy will work or not will depend on what the relationship is between the three tables involved (one to one, one to many, etc.).
What I do want to point out here in case it helps, is the use of an IF clause. Maybe a CASE clause would be more appropriate (in all my MySQL usage I have not ever used a CASE clause yet :) )