我实在是没看懂你的意思
“xh不一样,但name的值完全相同的xh”是什么意思?
在加上后面那个例子就更不懂了

解决方案 »

  1.   

    xh就象组号,name就象几个人一样譬如:同样几个人在第一组,而同样几个人又在第5组,不是重复了吗,只不过组号不同罢了,而组成的人相同。
    我就想查出这样的情况!
      

  2.   

    感觉应该先弄个视图或者子查询,返回xh,对应的字母排序后的组合,例如:
    1 abc
    2 bcd
    3 fbc
    然后在此基础上,再查组合字段一样的
      

  3.   

    http://community.csdn.net/Expert/topic/5037/5037398.xml?temp=.4006006
    看上面那个帖子,
    将表变成:
    xh      name
    1       abc
    2       cdb
    3       fbc
    4       abc

    然后直接判断 name 就可以。
      

  4.   

    在sqlserver中:
    create function fnGetName( @sXh varchar(20)
    ) returns varchar(200) as
    begin
    declare @sName varchar(200)
    set @sName='';
    select @sName = @sName + sName from test where xh=@sxh
    return @sName
    )select xh from (
      select distinct xh,sName=fnGetName(xh) from test 
    ) a group by xh having count(*)>1