Suppose I have these tables
create table bug ( id int primary key, name varchar(20) ) create table blocking ( pk int primary key, id int,
make sure the inner query only returns one row. You may have to add a top 1 on it if it returns more than one.
select t1.id, t1.name, (select b.name from #blocking b where b.id=t1.id and b.name='qa bug') from #bug t1