Du bliver nødt til at duplikere IF
ring dertil. For eksempel:
SELECT
name,
IF(apple = 'brown', color1, color2) AS ripeness
FROM
apples
JOIN apple_type ON apple_type.color = IF(apple = 'brown', color1, color2)
Du bliver nødt til at duplikere IF
ring dertil. For eksempel:
SELECT
name,
IF(apple = 'brown', color1, color2) AS ripeness
FROM
apples
JOIN apple_type ON apple_type.color = IF(apple = 'brown', color1, color2)