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
程式碼只做參考
來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/2370/viewspace-2807811/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- 連線查詢簡析 join 、 left join 、 right join
- mysql INNER JOIN、LEFT JOIN、RIGHT JOIN;內連線(等值連線)、左連線、右連線MySql
- MySql的join(連線)查詢 (三表 left join 寫法)MySql
- MySQL LEFT JOIN/ INNER JOIN/RIGHT JOINMySql
- SQL中聯表查詢操作(LEFT JOIN, RIGHT JOIN, INNER JOIN)SQL
- sql 連線查詢例項(left join)三表連線查詢SQL
- 兩種連線的表達 :left(right) join 和 (+)
- sql中的join、left join、right joinSQL
- MySQL筆記-左連線的使用(left join有關聯的多表查詢)MySql筆記
- MYSQL count標量子查詢改left joinMySql
- mysql中的left join、right join 、inner join的詳細用法MySql
- Oracle Left join right jionOracle
- LEFT JOIN 和JOIN 多表連線
- oracle update left join查詢Oracle
- sql left join 和 right join解釋SQL
- join、inner join、left join、right join、outer join的區別
- sql之left join、right join、inner join的區別SQL
- Hibernate連線查詢join
- MySQL join連表查詢示例MySql
- mysql + left joinMySql
- sql的left join 、right join 、inner join之間的區別SQL
- MYSQL 怎麼 LEFT JOIN 多表聯查MySql
- 用LEFT JOIN優化標量子查詢優化
- mysql求交集:UNION ALL合併查詢,inner join內連線查詢,IN/EXISTS子查詢MySql
- left join,right join,inner join的條件on和where的區別
- mysql left join轉inner joinMySql
- 三表關聯查詢-多次LEFT JOIN...ON
- Mysql中常用函式 分組,連線查詢MySql函式
- mysql中多個left join子查詢寫法以及別名用法MySql
- MySQL之連線查詢MySql
- 【MySQL】LEFT JOIN 踩坑MySql
- 【SQL】13 SQL 別名、SQL 連線(JOIN)、SQL INNER JOIN 關鍵字、SQL LEFT JOIN 關鍵字、SQL RIGHT JOIN 關鍵字、SQL FULL OUTER JSQL
- oracle的left join,right join和full join的一點介紹(R1)Oracle
- MySQL之連線查詢和子查詢MySql
- mysql查詢語句5:連線查詢MySql
- MySQL學習-連線查詢MySql
- MySQL8:連線查詢MySql
- mysql-分組查詢-子查詢-連線查詢-組合查詢MySql