select * from 表 A join 表 B on A.mobile=B.mobile and A.s_code<>B.s_code

解决方案 »

  1.   

    select b.* from stone b,
    (select mobile,count(*) from stone
    group by mobile
    having count(*)>1) a
    where a.mobile = b.mobile
      

  2.   

    select distinct mobile, s_code from stone
     order by mobile, s_code
      

  3.   

    没试过,不知道可以不select distinct * from table AA where (select count(s_code) from table where mobile=AA.mobile)>1
      

  4.   

    select *
    from stone s
    where exists(select * from stone st where s.mobile=st.mobile and
                                              s.s_code<>st.s_code)
      

  5.   

    select a.* 
    from mobile a,
    (select mobile, cnt=count(*) from stone group by mobile) b,
    where a.mobile = b.mobile 
      and b.cnt > 1 不应该有mobile和s_code都相同的记录.
      

  6.   

    select *
    from stone t1
    join stone t2 on(t1.mobile=t2.mobile)
    where t1.s_code<>t2.s_code