从不同的表中获取结果

时间:2012-05-17 18:24:06

标签: mysql sql select

我想从table1获取application_id,其中genre_id = 123,language_code = EN来自table2。

表格式:

表1:

EXPORT_DATE
genre_id
APPLICATION_ID

表2:

EXPORT_DATE
APPLICATION_ID
language_code

1 个答案:

答案 0 :(得分:0)

试试这个

SELECT Table1.application_id
FROM Table1 
INNER JOIN Table2 ON Table2.application_id = Table1.application_id
WHERE Table1.genre_id = 123
AND Table2.language_code = 'EN'