結果 : join two tables sql based on condition