Budete muset duplikovat IF
zavolej tam. Například:
SELECT
name,
IF(apple = 'brown', color1, color2) AS ripeness
FROM
apples
JOIN apple_type ON apple_type.color = IF(apple = 'brown', color1, color2)
Budete muset duplikovat IF
zavolej tam. Například:
SELECT
name,
IF(apple = 'brown', color1, color2) AS ripeness
FROM
apples
JOIN apple_type ON apple_type.color = IF(apple = 'brown', color1, color2)