当前位置:网站首页>Seven join join queries of MySQL

Seven join join queries of MySQL

2022-07-05 04:05:00 ganganlee

mysql join Query is an essential knowledge in development , Here are seven common join Query statement , Easy to learn
 Insert picture description here
One 、 Internal connection

sleect * from a inner join b on a.key = b.ky;

Two 、 Left connection

select * from a left join b on a.key = b.key;

3、 ... and 、 The right connection

select * from a right join b on a.key - b.key;

Four 、 Left monopoly

select * from a left join b on a.key = b.key where b.kry is null;

5、 ... and 、 Right exclusive

select * from a right join b on a.key = b.key where a.key is null;

6、 ... and 、 Full connection

select * from a left join b on a.key = b.key union select * from a right join b on a.key = b.key;

7、 ... and 、 Full exclusivity

seelct * from a left join a on a.key = b.key where a.key is null union select * from a right join b on a.key = b.key where b.key is null;
原网站

版权声明
本文为[ganganlee]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/186/202207050401567214.html