MySQL join高级用法
MySQL的join语句用的很多,比如和字典进行联查时,可以用left join或者inner join;
两张MySQL表:
t1:
t2:
join进行update
update t1 inner join t2 on t1.a = t2.a set t1.b =t2.c where 1=1;
join进行delete
delete t1,t2 from t1 inner join t2 on t1.a=t2.a where 1=1 ;
MySQL的join语句用的很多,比如和字典进行联查时,可以用left join或者inner join;
两张MySQL表:
t1:
t2:
update t1 inner join t2 on t1.a = t2.a set t1.b =t2.c where 1=1;
delete t1,t2 from t1 inner join t2 on t1.a=t2.a where 1=1 ;