2017-07-04 107 views

回答

1

您可以加入兩個表如下所示:下面的查詢

SELECT t2.Fail_reason 
FROM TABLE_1 as t1 JOIN TABLE_2 as t2 on t1.Fail_id = t2.Fail_id 
WHERE t1.Line_id = 1 
1

嘗試。這將爲您輸出所有記錄。如果您需要篩選特定Line_id的輸出,則可以添加WHERE條件。

SELECT t1.Line_id, t2.Fail_reason 
FROM TABLE_1 t1 JOIN TABLE_2 t2 ON t1.Fail_id = t2.Fail_id; 
相關問題