不要让mysql犹豫不决

Posted rsapaper

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了不要让mysql犹豫不决相关的知识,希望对你有一定的参考价值。

 1 DROP TABLE IF EXISTS `w1`;
 2 CREATE TABLE `w1` (
 3   `waid` int(11) NOT NULL AUTO_INCREMENT,
 4   `wa1` varchar(255) COLLATE utf8mb4_bin DEFAULT NULL,
 5   `wa2` varchar(255) COLLATE utf8mb4_bin DEFAULT NULL,
 6   PRIMARY KEY (`waid`)
 7 ) ENGINE=MyISAM AUTO_INCREMENT=3 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_bin;
 8 
 9 -- ----------------------------
10 -- Records of w1
11 -- ----------------------------
12 INSERT INTO `w1` VALUES (1, w1-1, 1);
13 INSERT INTO `w1` VALUES (2, w1-2, 2);
 1 DROP TABLE IF EXISTS `w2`;
 2 CREATE TABLE `w2` (
 3   `wbid` int(11) NOT NULL AUTO_INCREMENT,
 4   `wb1` varchar(255) COLLATE utf8mb4_bin DEFAULT NULL,
 5   `wb2` varchar(255) COLLATE utf8mb4_bin DEFAULT NULL,
 6   PRIMARY KEY (`wbid`)
 7 ) ENGINE=MyISAM AUTO_INCREMENT=3 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_bin;
 8 
 9 -- ----------------------------
10 -- Records of w2
11 -- ----------------------------
12 INSERT INTO `w2` VALUES (1, w2-1, 2);
13 INSERT INTO `w2` VALUES (2, w2-2, 2);

 

 1 SELECT * FROM w1 LEFT JOIN w2 ON w1.wa2=w2.wb2
 2 SELECT * FROM w1 LEFT JOIN w2 ON w2.wb2=w1.wa2
 3 
 4 SELECT * FROM w2 RIGHT JOIN w1 ON w1.wa2=w2.wb2
 5 SELECT * FROM w2 RIGHT JOIN w1 ON w2.wb2=w1.wa2
 6 
 7 
 8 SELECT * FROM w2 LEFT JOIN w1 ON w1.wa2=w2.wb2
 9 SELECT * FROM w2 LEFT JOIN w1 ON w2.wb2=w1.wa2
10 
11 SELECT * FROM w1 RIGHT JOIN w2 ON w1.wa2=w2.wb2
12 SELECT * FROM w1 RIGHT JOIN w2 ON w2.wb2=w1.wa2
13 
14 
15 SELECT * FROM w1 INNER JOIN w2 ON w1.wa2=w2.wb2
16 SELECT * FROM w1 INNER JOIN w2 ON w2.wb2=w1.wa2
17 SELECT * FROM w1 CROSS JOIN w2 ON w1.wa2=w2.wb2
18 SELECT * FROM w1 CROSS JOIN w2 ON w2.wb2=w1.wa2
19 
20 SELECT * FROM w2 INNER JOIN w1 ON w1.wa2=w2.wb2
21 SELECT * FROM w2 INNER JOIN w1 ON w2.wb2=w1.wa2
22 SELECT * FROM w2 CROSS JOIN w1 ON w1.wa2=w2.wb2
23 SELECT * FROM w2 CROSS JOIN w1 ON w2.wb2=w1.wa2

 

以上是关于不要让mysql犹豫不决的主要内容,如果未能解决你的问题,请参考以下文章

犹豫故事

编写代码片段的更简洁的方法

如何在片段中使用按钮[关闭]

不要在片段中显示列表视图项

犹豫的英语的啥?

焦点AI编译器开始的AI“芯“历程;华登国际王林:接地气的团队投资千万不要犹豫;CES Asia 2020延期举办;