I know this doesn't fully cover your question, but you can do something like:select customernumber ,yearseq ,monthseq ,sum(case when productarea=1 then rev1 else 0 end) as area1rev1 ,sum(case when productarea=1 then rev2 else 0 end) as area1rev2 ,sum(case when productarea=1 then rev3 else 0 end) as area1rev3 ,sum(case when productarea=2 then rev1 else 0 end) as area2rev1 ,sum(case when productarea=2 then rev2 else 0 end) as area2rev2 ,sum(case when productarea=2 then rev3 else 0 end) as area2rev3 from data1.dbo.allrev where customernumber='7474' and monthseq='1' and yearseq='2014' group by customernumber ,yearseq ,monthseq
This assumes your procuctarea is nummeric and you are interested in productarea 1 and 2. This can easily be changed to fit your situation.