通过两次加入同一个表,我有一个相同的解决方案,但我想知道下面的查询是否可以优化?
select oc.name as father_occupation, o.name as mother_occupation
from user_family uf
left join occupations oc on uf.father_occupation = oc.occupation_id
left join occupations o on uf.mother_occupation = o.occupation_id
where user_id = 1;