那么怎么可以體現(xiàn)二者區(qū)別呢?
很簡單,連接時對應(yīng)字段一致。也就是:
select a.user_name,a.over,b.over
... from user1 a left join user2 b on a.user_name=b.user_name
... union
... select b.user_name,a.over,b.over
... from user1 a right join user2 b on a.user_name=b.user_name;
這樣執(zhí)行select后結(jié)果分別是8和9