只要是字段值相同的记录都要取出来。

解决方案 »

  1.   

    select * from 用户.表 where 字段1='相同值'
      

  2.   

    select count(*) from violation_t_i a where a.rowid !=(select max(b.rowid) from violation_t_i b where a.ysbh=b.ysbh and a.wfsj=b.wfsj )
      

  3.   

    select * from 表名 where 字段 in (select 字段 from 表名 group by 字段 having count(*)>1;
      

  4.   

    select * from table1 a
    where a.rowid > (select min(rowid) from table1 b where a.id=b.id)
      

  5.   

    ex:select *
    from cat_org
    where CREATE_USERNAME in
             (select distinct CREATE_USERNAME
             from cat_org
             group by CREATE_USERNAME 
             having count(*) >1
             )
      

  6.   

    ex:select *
    from cat_org
    where CREATE_USERNAME in
             (select distinct CREATE_USERNAME
             from cat_org
             group by CREATE_USERNAME 
             having count(*) >1
             )
      

  7.   

    SQL> select job from emp;JOB
    ---------
    CLERK
    SALESMAN
    SALESMAN
    MANAGER
    SALESMAN
    MANAGER
    MANAGER
    ANALYST
    PRESIDENT
    SALESMAN
    CLERK
    CLERK
    ANALYST
    CLERK已選取 14 個資料列.SQL> select job from emp group by job having count(job)>1;JOB
    ---------
    ANALYST
    CLERK
    MANAGER
    SALESMAN
      

  8.   

    select * from table1 a
    where exists (select * from table1 b where b.id=a.id and b.rowid<>a.rowid)
      

  9.   

    select  字段名 from 表名 k  where k.字段名= '某值 ' group by k.字段名 having count(k.字段名) >1