内连接(INNER JOIN)
有两种,显式的和隐式的,返回连接表中符合连接条件和查询条件的数据行
格式:
隐式:SELECT [cols_list] from 表1,表2 where [condition]
显式:SELECT [cols_list] from 表1 INNER JOIN 表2 ON [关联条件] where [其他筛选条件]
SELECT [cols_list] from 表1 CROSS JOIN 表2 ON [关联条件] where [其他筛选条件]
SELECT [cols_list] from 表1 JOIN 表2 ON [关联条件] where [其他筛选条件]
外连接(OUTER JOIN)
外连接分为:
左外连接(LEFT OUTER JOIN),简称左连接(LEFT JOIN)
右外连接(RIGHT OUTER JOIN),简称右连接(RIGHT JOIN)
全外连接(FULL OUTER JOIN),简称全连接(FULL JOIN)
转载原文链接:http://www.atguigu.com/jsfx/14174.html
特别声明:以上内容(如有图片或视频亦包括在内)为自媒体平台“网易号”用户上传并发布,本平台仅提供信息存储服务。
Notice: The content above (including the pictures and videos if any) is uploaded and posted by a user of NetEase Hao, which is a social media platform and only provides information storage services.