本文介绍了如何在SQL中过滤重复记录的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
select vCompanyName,vemailid
from tblmembers
在这里,我不想重复vCompanyName
重复但不起作用
请帮助..
here i dont want duplicate vCompanyName
itried with distinct but not working
pls help..
推荐答案
SELECT vCompanyName, MIN(vemailid)
FROM results
GROUP BY vCompanyName
Select tmp.vCompanyName , tblmembers.vemailid
from
(
Select vCompanyName from tblmembers
group by vCompanyName
having count(vCompanyName) =1
) As tmp
inner join tblmembers on tblmembers.vCompanyName =tmp.vCompanyName
select distinct vCompanyName from tblmembers
希望这对您有帮助
hope this helps you
这篇关于如何在SQL中过滤重复记录的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!