欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页  >  数据库

INNER LEFT RIGHT JOIN语句_MySQL

程序员文章站 2022-06-16 08:50:27
...
bitsCN.com
INNER LEFT RIGHT JOIN语句 Sql代码 CREATE TABLE `a` ( `a1` VARCHAR(10) DEFAULT NULL, `b1` VARCHAR(10) DEFAULT NULL, `c1` VARCHAR(10) DEFAULT NULL ) ENGINE=INNODB DEFAULT CHARSET=utf8 CREATE TABLE `b` ( `a2` VARCHAR(10) DEFAULT NULL, `b2` VARCHAR(10) DEFAULT NULL ) ENGINE=INNODB DEFAULT CHARSET=utf8 创建出表,表内数据如下: INNER LEFT RIGHT JOIN语句_MySQLINNER LEFT RIGHT JOIN语句_MySQL SQL语句执行结果图片在语句的下方 Sql代码 #inner join SELECT A.*,B.* FROM a INNER JOIN B ON a.a1=b.a2 INNER LEFT RIGHT JOIN语句_MySQL Sql代码 #left join SELECT A.*,B.* FROM a LEFT OUTER JOIN b ON a.a1 = b.a2 INNER LEFT RIGHT JOIN语句_MySQL Sql代码 #right join SELECT A.*,B.* FROM a RIGHT OUTER JOIN b ON a.a1 = b.a2 INNER LEFT RIGHT JOIN语句_MySQL Sql代码 #full outer join union SELECT A.*,B.* FROM a LEFT OUTER JOIN b ON a.a1 = b.a2 UNION SELECT A.*,B.* FROM a RIGHT OUTER JOIN b ON a.a1 = b.a2 INNER LEFT RIGHT JOIN语句_MySQL Sql代码 SELECT A.*, B.* FROM A,B INNER LEFT RIGHT JOIN语句_MySQL Sql代码 SELECT A.*,B.* FROM a JOIN b ON a.a1 = b.a2 默认是inner join
INNER LEFT RIGHT JOIN语句_MySQL
bitsCN.com
相关标签: 10 a1