I have a table like as follows:
SoftwareName Count Country Project 15 Canada Visio 12 Canada Project 10 USA Visi
OK...Here's how to do it using PIVOT:
SELECT Softwarename, Canada, USA, Canada + USA As TOTAL from SoftwareDemo
PIVOT
(
SUM([Count])
FOR Country
IN (Canada, USA)
) AS x
Softwarename Canada USA TOTAL
-------------------------------------------------- ----------- ----------- -----------
Project 15 10 25
Visio 12 5 17
(2 row(s) affected)