「table1」に「keyword1」を持つレコードがある。目的
「table2」に、「keyword1」と「keyword2」を持つレコードがある。
table1にあり、条件conditionsを満たすレコードのkeyword1 値で、table2から、keyword1値と(重複しない)keyword2を持つレコードを検索するSQL
select distinct keyword2
from table2
where table1 in (
select distinct keyword1 table1 where conditions
)
No comments:
Post a Comment