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. WebDesignerWall 2. Veerle's Blog 3. Tutori...
The most common, most commonly used and most gener...
effect: The GROUP_CONCAT function can concatenate...
Preface binlog is a binary log file, which record...
1. New Features MySQL 5.7 is an exciting mileston...
Table of contents 1. Introduction 2. Configure My...
<br />In the entire product design process, ...
When using MySQL to query the database and execut...
MySQL's CAST() and CONVERT() functions can be...
Main differences: 1. Type SQL databases are prima...
PHP related paths in Ubuntu environment PHP path ...
This article shares the specific code of Vue to i...
All consecutive spaces or blank lines (newlines) ...
Version Chain In InnoDB engine tables, there are ...
Table of contents 1. Resources and Construction 1...