mysql常用連線查詢join,left,right,cross

suliver發表於2021-09-09
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

程式碼只做參考

來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/2370/viewspace-2807811/,如需轉載,請註明出處,否則將追究法律責任。

相關文章