表中有一个字段是存储如"1,15,89,1245"内容的,想查询有重复值的记录如"45,56,789,789"中"789"是重复,谢谢

解决方案 »

  1.   

    select a.* from table a,table b where a.column=b.column and a.rowid<>b.rowid
      

  2.   

    select a.* from table_a a where a.column not in (select b.column from table_b b where a.column<>b.column);
      

  3.   


         表Test中有字段a 有重复的记录。
     
        select distinct(a), count(a)
      from test
     where a in
           (select distinct(a)  from test)
     group by a;  可查出字段a ,以及它在表test中有多少重复的记录!
      

  4.   

    表a
    字段 id   a
          1   12,125,789,4561
          2   452,4578,45,89
          3   12,456,456
    只查询处第3条
      

  5.   

    相当复杂啊。不知道有没相关的函数。
    感觉需要写存储过程来实现。
    我的思路是
    CURSOR A IS 
    SELECT * FROM A;
    for record_a in a loop 
    中间先把字段a的东西通过,分割开来,然后循环比较这样子
    end loop;