if object_id('test') is not null
drop table test
go
create table test(a varchar(10),b varchar(3),c varchar(4))
insert into test select 'AAA','a','CCC'
union all select 'BBB','b','AAA'
union all select 'CCC','c','BBB'
select *,d=(select b from test where a=t.c) from test t
a b c d
---------- ---- ---- ----
AAA a CCC c
BBB b AAA a
CCC c BBB b





2007-5-4 15:30 

