<p class="sougouContent"> </p> <p class="tag"> php mysql 数据 </p> 比如一个用户表,username 有相同的,怎么把这些相同的名字都查出来,,,,,, <br> <h2>回复讨论(解决方案)</h2> <p class="sougouAnswer"> 假设你的用户表有个主键id <br> select * from 用户表 t where exists(select 1 from 用户表 where username=t.username and id t.id); </p> <p class="sougouAnswer"> <div class="code" style="position:relative; padding:0px; margin:0px;"><pre class="sycode" name="code">select * from tbname group by name having count(name)>1</pre><div class="contentsignin">登录后复制</div></div> </p> <p class="sougouAnswer"> 灰常感谢!!! </p>