 <p>How about something like this:</p> <pre><code>create table #tempTab(Num int,rtype char(1),amount decimal(8,2)); insert into #tempTab values (110200014,'A',19259.00), (110200014,'D',-802.46), (110200014,'D',-1604.92) select * from #tempTab t cross apply (select amount from #tempTab where rtype = 'A' and Num = t.Num) pa; </code></pre>