declare @t table(a varchar(10),b varchar(10))
insert into @t select 'x','a'
union all select 'x','b'
union all select 'y','a'
union all select 'y','d'
union all select 'z','e'
select * from @t a where exists(select * from @t where b='a' and a.a=a)
--这样?