建站软件 优化软件 编程软件 网页辅助 站群程序 网站程序 图像处理 资源教程 字体下载 推荐软件


您的位置:首页 > MYSQL学习 > mysql实现多表联结查询介绍

mysql实现多表联结查询介绍

时间:2015-05-26 20:16:10  来源:免费模板网 作者:风雪 阅读次数 tags联结查询

MySQL支持Select和某些Update和Delete情况下的Join语法,具体语法上的细节有:

 table_references:

    table_reference [, table_reference] …

 table_reference:

    table_factor

  | join_table

 table_factor:

    tbl_name [[AS] alias]

        [{USE|IGNORE|FORCE} INDEX (key_list)]

  | ( table_references )

  | { OJ table_reference LEFT OUTER JOIN table_reference

        ON conditional_expr }

 join_table:

    table_reference [INNER | CROSS] JOIN table_factor [join_condition]

  | table_reference STRAIGHT_JOIN table_factor

  | table_reference STRAIGHT_JOIN table_factor ON condition

  | table_reference LEFT [OUTER] JOIN table_reference join_condition

  | table_reference NATURAL [LEFT [OUTER]] JOIN table_factor

  | table_reference RIGHT [OUTER] JOIN table_reference join_condition

  | table_reference NATURAL [RIGHT [OUTER]] JOIN table_factor

 join_condition:

    ON conditional_expr | USING (column_list)

 

SELECT * FROM t1 LEFT JOIN (t2, t3, t4) ON (t2.a=t1.a AND t3.b=t1.b AND t4.c=t1.c)

本文地址:https://www.freemoban.com/mysql/2015/0526/1963.html

猜你喜欢
栏目推荐
模板推荐

Copyright:www.freemoban.com 免费模板网 All Rights Reserved 网站备案:辽ICP备19014872号-2   辽公网安备 21010602000376号  辽公网安备:42900402000182号

免责声明:本站部分资源来自互联网收集,版权归原创者所有,如果侵犯了你的权益,我们会及时删除侵权内容,联系QQ:1615187561 谢谢合作!