我有两张桌子:
Table_in_french
- french_valueTable_translated_value
- french_value
- spanish_value
我需要浏览Table_in_french并显示链接的西班牙语值(如果存在)或法语值(如果没有可用的翻译)。
我试过了:
SELECT (CASE WHEN (T1.french_value = T2.french_value) THEN spanish_value ELSE T1.french_value END) as label FROM Table_in_french T1, Table_translated_value T2;
但是我的重复值太多了。
提前致谢
答案 0 :(得分:1)
Try this query:
SELECT (CASE WHEN (T1.french_value = T2.french_value) THEN spanish_value ELSE T1.french_value END) AS label FROM Table_in_french T1 RIGHT JOIN Table_translated_value T2 ON T1.french_value = T2.french_value;