The difference between left join and inner join

 

Example a, b table:

bId bNum
1 20
2 30

 

aId aNum
1 10
2 20
3 30

 

left join is subject to the left table

select * from a left join b on a.aId=b.bId;

aId aNum bId bNum
1 10 1 20
2 20 2 30
3 30 NULL NULL

 

 

Inner join selects both tables, which are equal one by one

aId aNum bId bNum
1 10 1 20
2 20 2 30

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=324928895&siteId=291194637