Home >Backend Development >PHP Tutorial >mysql三表连接查询问题

mysql三表连接查询问题

WBOY
WBOYOriginal
2016-06-23 14:19:161662browse

三表左连接查询,为何会出现重复数据,有木有大神讲解一下原因啦啦啦啦!比如现在我单独查询有九条记录,但是还需要其他附属表的字段,结果连接查询出现重复数据,总数也是九条,这是神马情况啊?


回复讨论(解决方案)

这要看你的sql指令是如何写的
还有就是重复的数据来自哪个表?

左链接的结果中必然包含左表的全部符合条件的记录

贴出表的结构,贴出写的sql。

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