結合に「qaバグ」基準を入力するだけです: select t1.*, t2.name from #bug t1 left join #blocking t2 on t1.id = t2.id AND t2.name = 'qa bug'