U moet de IF
. dupliceren bel daar. Bijvoorbeeld:
SELECT
name,
IF(apple = 'brown', color1, color2) AS ripeness
FROM
apples
JOIN apple_type ON apple_type.color = IF(apple = 'brown', color1, color2)
U moet de IF
. dupliceren bel daar. Bijvoorbeeld:
SELECT
name,
IF(apple = 'brown', color1, color2) AS ripeness
FROM
apples
JOIN apple_type ON apple_type.color = IF(apple = 'brown', color1, color2)