手记

mysql常用连接查询join,left,right,cross

select package_name_en  from tb_feature_package a cross join tb_package b on a.package_sid =b.sid where package_name_en is not null

select package_name_en  from tb_feature_package a left join tb_package b on a.package_sid =b.sid where package_name_en is not null
union
select package_name_en  from tb_feature_package a right join tb_package b on a.package_sid =b.sid where package_name_en is not null

update  tb_package b join(
select a.package_sid from tb_feature_package a join tb_package b on a.package_sid =b.sid
) a on a.package_sid =b.sid set b.package_name_en =b.package_name 
where b.package_name_en is  null

代码只做参考

0人推荐
随时随地看视频
慕课网APP