MySQL multi-table query (Cartesian product principle)
Note: It is best to use table aliases to distinguish column names. Cartesian Product Demo: Left, right, inner, outer joins Inner join: Important: All matching records are returned. select * from a,b where ax = bx ////Inner join l There are two types of outer joins: left join and right join. Key points: All matching records are returned plus one record for each row where the primary table foreign key value is null. All columns of the auxiliary table are null values. select * from a left join b on ax=bx order by ax //Left outer join or left join select * from a right join b on ax=bx order by ax //Right outer join or right join Select clause order
This concludes this article on how to use the Cartesian product principle in MySQL to perform multi-table queries. For more information about MySQL multi-table queries, please search for previous articles on 123WORDPRESS.COM or continue to browse the following related articles. I hope you will support 123WORDPRESS.COM in the future! You may also be interested in:
|
<<: Detailed explanation of Linux rpm and yum commands and usage
>>: Detailed tutorial on installing MariaDB on CentOS 8
1. Create a new user wwweee000 [root@localhost ~]...
Table of contents 1. Bootstrap5 breakpoints 1.1 M...
Before introducing the new CSS property contain, ...
I just want to make a small thing that combines w...
Table of contents 1. Introduction to label statem...
Mysql5.7.19 version is a new version launched thi...
Table of contents How to represent the current ti...
Introduction to Nginx Nginx ("engine x"...
1. What is Docker? Everyone knows about virtual m...
Tomcat is an HTTP server that is the official ref...
--Homepage backup 1.txt text 2. Scan the image 3. ...
Uninstall old versions If you have installed an o...
Database application is an indispensable part of ...
Obvious HTML, hidden "public script" Th...