mysql統(tǒng)計重復數(shù)據(jù),在mysql中兩個表連接的字段數(shù)據(jù)重復?
手機打字,錯字見諒
左連接(left join):
table1 left join table2 where table1.a = table2.a and table1.a = “123”;
意思是說,先通過第二個條件查出table1中的滿足條件的row數(shù)據(jù)條數(shù)n條,查出的n條數(shù)據(jù)再left join table2 通過第一個條件連接起來,查出的數(shù)據(jù)條數(shù)任為n條
右鏈接(right join):
table1 right join table2 where table1.a = table2.a and table1.a = “123”;
同理,查出數(shù)據(jù)的條數(shù)和table2查出的數(shù)據(jù)條數(shù)相同
全鏈接(full join):
table1 full join table2 where table1.a = table2.a and table1.a = “123”;
先通過第二個條件查出table1和table2的數(shù)據(jù),然后通過第一個條件全部連接