假设有两张表:
表1:tab1
id size
1 10
2 20
3 30
表2:tab2
size name
10 AAA
20 BBB
20 CCC
两条SQL:
1、select * form tab1 left join tab2 on (tab1.size = tab2.size) where tab2.name=’AAA’
2、select * form tab1 left join tab2 on (tab1.size = tab2.size and tab2.name=’AAA’)