Home  >  Article  >  Backend Development  >  MySQL 左关联查询中两个以上数据表查询时,怎么得到唯一匹配的数据

MySQL 左关联查询中两个以上数据表查询时,怎么得到唯一匹配的数据

WBOY
WBOYOriginal
2016-06-13 10:22:341191browse

MySQL 左关联查询中两个以上数据表查询时,如何得到唯一匹配的数据
各位高手:
  我在使用左关联查询时,要涉及到两个以上的数据表,虽然可以查询出数据,但是却出现多个匹配结果的情况,就好像是使用了普通的关联查询一样,请高手指教指教,不胜感激,谢谢了。

------解决方案--------------------
select *
from a left join b on a.id=b.id 
 left c on a.id=c.id
------解决方案--------------------
需要在后面加个where条件
------解决方案--------------------
left join ON条件
还有 where
------解决方案--------------------
ID 数据类型必须匹配

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn