比如:select * from table where name = 'a' and age ='b' and address ='c'
union
select * from table where name = 'q' and age ='w' and address ='e'
union
select * from table where name = 'j' and age ='k' and address ='l'
begin
select *,Identity(int,1,1) as Id into #temp from table
select * from #temp a,(
select * from #temp where name = 'a' and age ='b' and address ='c'
union
select * from #temp where name = 'q' and age ='w' and address ='e'
union
select * from #temp where name = 'j' and age ='k' and address ='l') b
where a.Id<>b.Id
end