2020
10-10
10-10
Mysql join联表及id自增实例解析
join的写法如果用leftjoin左边的表一定是驱动表吗?两个表的join包含多个条件的等值匹配,都要写道on还是只把一个写到on,其余写道where部分?createtablea(f1int,f2int,index(f1))engine=innodb;createtableb(f1int,f2int)engine=innodb;insertintoavalues(1,1),(2,2),(3,3),(4,4),(5,5),(6,6);insertintobvalues(3,3),(4,4),(5,5),(6,6),(7,7),(8,8);select*fromaleftjoinbon(a.f1=b.f1)and(a.f2...
继续阅读 >