if
object_id('table1')
is
not
null
begin
drop
table
table1
end
go
create
table
table1
(a
int
,b
int)
go
insert
into
table1
select
1,1
union
select
1,2
union
select
1,3
union
select
2,1
go
SELECT
a.*
from
table1
a
where
exists(select
*
from
table1
b
where
a.a=b.a
and
a.b<>b.b
)
--记得及时采纳,今天任务还没完成,只差一个了