一个表
create table RSB
(
id char(6) 
xm char(10)
)
insert into RSB values('1000','没什么')
insert into RSB values('1001','干什么')
insert into RSB values('1002','做什么')
insert into RSB values('1002','做什么')怎么样把里面重复的ID 给列出来呢?~~

解决方案 »

  1.   

    create table RSB
    (
    id char(6), 
    xm char(10)
    )
    insert into RSB values('1000','没什么')
    insert into RSB values('1001','干什么')
    insert into RSB values('1002','做什么')
    insert into RSB values('1002','做什么')select id from RSB
    group by id
    having count(*)>1drop table RSB
      

  2.   

    select id from rsb
    group by id having count(*)>1
      

  3.   

    select ID from RSB group by ID having count(*)>1
      

  4.   

    select * from RSB group by id having count(id)>1
      

  5.   

    select id,count(1) from RSB group by id having count(1)>1
      

  6.   

    select id from rsb
    group by id having count(*)>1
      

  7.   

    SELECT id FROM rsb  GROUP BY id HAVING COUNT(*)>1