Mysql 用于返回所有匹配值的SQL查询
我想从这两个表中得到具体的输出Mysql 用于返回所有匹配值的SQL查询,mysql,Mysql,我想从这两个表中得到具体的输出 Table 1: A 1 Table 2: A Appple B 2 A Apollo C 3 B Ball 所需输出为: Table 3: A 1 Apple A 1 Apollo B 2 Ball C 3 我是编程新手..我应该如何获得所需的结果..left join是从第二个表中获取所有匹配的记录还是仅获取一条记录?I simple left join
Table 1: A 1 Table 2: A Appple
B 2 A Apollo
C 3 B Ball
所需输出为:
Table 3:
A 1 Apple
A 1 Apollo
B 2 Ball
C 3
我是编程新手..我应该如何获得所需的结果..left join是从第二个表中获取所有匹配的记录还是仅获取一条记录?I simple left join
select a.col1, a.col2, b.col2
from table1 as a left join table 2 as b on a.col1 = b.col1
左连接听起来是个很好的主意。