weixin_45415742
2020-01-20 17:07
采纳率: 66.7%
浏览 983

SqlServer去重一个字段,显示多个指定字段,求赐教

select e.Company,p.Name,p.Linkman,p.Tel,p.Email,pa.Name,pa.Budget,pa.Account,eu.TrueName,eu.Name,eu.Password,eu.Tel,eu.Email,eu.Role,eu.EUCode,COUNT(distinct eu.Name) from tEUInfo e
INNER join tPart p
on p.EUID=e.EUID
INNER join tPayCenter pa
on pa.PartID=p.PartID
INNER join tEUAccount eu
on eu.PCID=pa.PCID
where EU.EUCode IN ('BJH4040','BJQB030','BJQ3030','BJQ5030','BJH3030','BJQ4040','BJQ6030')
  • 点赞
  • 收藏

1条回答 默认 最新

  • 封印di恶魔 2020-01-20 18:07
    已采纳

    最后加个 group by (你要合并的字段)

    点赞 打赏 评论

相关推荐 更多相似问题