1. Create a tableCREATE TABLE `student` ( `id` int(11) NOT NULL, `name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL, `age` int(11) NULL DEFAULT NULL, PRIMARY KEY (`id`) USING BTREE ) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci ROW_FORMAT = Dynamic; INSERT INTO `student` VALUES (1, '张三', 12); INSERT INTO `student` VALUES (2, '李四', 12); INSERT INTO `student` VALUES (3, '王五', 12); INSERT INTO `student` VALUES (4, '赵六', 12); INSERT INTO `student` VALUES (5, '孙七', 12); INSERT INTO `student` VALUES (6, 'turtle', 12); CREATE TABLE `grade` ( `id` int(11) NOT NULL, `sid` int(11) NULL DEFAULT NULL, `grade` int(11) NULL DEFAULT NULL, PRIMARY KEY (`id`) USING BTREE ) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci ROW_FORMAT = Dynamic; INSERT INTO `grade` VALUES (1, 1, 100); INSERT INTO `grade` VALUES (2, 2, 80); INSERT INTO `grade` VALUES (3, 3, 99); INSERT INTO `grade` VALUES (4, 4, 66); 2. Inner joinThere is no difference between and and where in inner joins. Both use the results after the join to perform conditional screening. 2.1 No conditions 2.2 and Condition 2.3 where condition 3. left join3.1 No conditions 3.2 and Condition In left join, the left table is fully matched for connection, and then AND is used for filtering; the left table data that does not meet the conditions is retained, and the right table data is null. 3.3 where condition In left join, the left table is fully matched for connection, and then the where clause is used for filtering; only the data that meets the conditions is filtered. 4. right joinSame as left join in 3, except that the base tables are reversed. 5. Conclusion
This is the end of this article about the difference between and and where in MySQL connection query. For more relevant MySQL connection query and where content, please search 123WORDPRESS.COM's previous articles or continue to browse the following related articles. I hope everyone will support 123WORDPRESS.COM in the future! You may also be interested in:
|
<<: Summary of Docker Consul container service updates and issues found
>>: Introduction to CSS style introduction methods and their advantages and disadvantages
Container is another core concept of Docker. Simp...
Table of contents 1. TypeScript is introduced int...
Dockerfile is a text file used to build an image....
This article discusses several major zero-copy te...
Management of input and output in the system 1. U...
The experimental environment is as follows Here y...
Table of contents 1. Object literals 2. The new k...
<br />This problem does not exist in many sm...
Table of contents Audio transcoding tools princip...
1. Design source code Copy code The code is as fol...
<br /> In the first and second parts, we int...
The relationship between Tomcat logs A picture is...
Border Style The border-style property specifies ...
Table of contents Overview Application scenarios ...
The conversion between time, string and timestamp...