sql join

1、inner, left, right, outer join 区别

        1.1、 https://www.cnblogs.com/reaptomorrow-flydream/p/8145610.html

 

2、joinwhere 的区别

       2.1、 论《LEFT JOIN条件放ON和WHERE后的区别》

              https://www.cnblogs.com/zsq23837880/p/7040923.html        

              2.1.1 因为数据库在通过连接两张或多张表来返回记录时,都会生成一张中间的临时表,然后再将这张临时表返回。

              在使用left jion时,on和where条件的区别如下:

                  1) on条件是在生成临时表时使用的条件,它不管on中的条件是否为真,都会返回左边表中的记录。

                  2) where条件是在临时表生成好后,再对临时表进行过滤的条件。

       

       2.2、 inner joinwhere  有什么区别?

              https://blog.csdn.net/forest_fire/article/details/68059313

              1)where 为隐性连接,INNER JOIN……ON 为显示连接。 两者所得结果一样;  

              2)  提高性能

                   a. 做表连接,大表在前,小表在后;

                   b .查询条件中的限制条件要写在表连接条件前; 

                   c. 尽量使用索引的字段做为查询条件;

                   d. 不使用表别名,通过字段前缀区分不同表中的字段 (少用);

3、join  使用业务场景

       3.1 、https://www.cnblogs.com/decwang/p/4647509.html

4、sql 题目   

      4.1、https://blog.csdn.net/zhang945254064/article/details/80305602

             

5、连续的 left join 用法

      5.1、https://bbs.csdn.net/topics/390741161

原文地址:https://www.cnblogs.com/Jomini/p/9709602.html