表的连接

来源:互联网 发布:数控编程培训班 编辑:程序博客网 时间:2024/05/19 20:18

表的连接有三种

  1. 内连接
    • 在MySQL中,JOIN,CROSS JOIN 和 INNER JOIN 是等价的。
  2. 左外连接 LEFT [OUTER] JOIN
  3. 右外连接 RIGHT [OUTER] JOIN

语法结构

table_reference {[INNER|CROSS] JOIN | {LEFT|RIGHT}[OUTER] JOIN } table_reference ON conditional_expr

mysql> UPDATE tdb_goods AS g INNER JOIN tdb_goods_brands AS b ON g.brand_name = b.brand_name    -> SET g.brand_name = b.brand_id;
0 0
原创粉丝点击