次のような単純な結合クエリがあります。
select *
from user u left join
user_roles ur
on ur.user_id = u.user_id
and ur.created_by = 'Mike'
where u.division = 'some division'
また
select *
from user u left join
user_roles ur
on ur.user_id = u.user_id
where u.division = 'some division'
and ur.created_by = 'Mike'
ポイントは、追加のフィルター句条件を左結合から where 句に移動したことです。
複数の列で 2 つのテーブルを結合したり、where 句に入れたりすると、違いはありますか?