I am using an IF statement in my mySQL SELECT statement and depending on the returned result from the IF statement I would like to join another table.
Eg. SELECT nam
You will have to duplicate the IF call there. For example:
IF
SELECT name, IF(apple = 'brown', color1, color2) AS ripeness FROM apples JOIN apple_type ON apple_type.color = IF(apple = 'brown', color1, color2)