有一个表tab,有二个字段,nodeid和title查出nodeid相等的,并且title有重复的记录

解决方案 »

  1.   

    select a.* from tt inner join
    (select nodeid,title from tt group by nodeid,title having count(*)>=2) b on
    a.nodeid=b.nodeid and a.title=b.title
      

  2.   

    select st.nodeid,st.title from test1 as st,
    (select nodeid,title from test1 Group by title,title having count(*)>1)as st1
    where st.nodeid=st1.nodeid and st.title=st1.title