Left and right connections difference

Left Join / Right Join /inner join相关

Simply put, the left is connected affect only the right table, right connection only affects the left table

The following example will give a more clear

Existing Table 1 user (user_id, user_name), Table 2 grade (user_id, coure, number)

Left connection:

select user.*,grade.*
from user
left outer join grade on(user.user_id=grade.user_id)

Right Connections:

select user.*,grade.*
from user
right outer join grade on(user.user_id=grade.user_id)

 

simply put:

LEFT JOIN: Some on the left, the right not to null

Right Connections: on the left is not the right there is null

 

Guess you like

Origin www.cnblogs.com/wudidamowang666/p/11314601.html