Thanks to Bob Silverberg for the following solution: 

SELECT            idItem, COUNT(*) AS TotalResponding,

SUM(CASE WHEN intValue = 0 THEN 1 ELSE 0 END) AS Count0,

SUM(CASE WHEN intValue = 1 THEN 1 ELSE 0 END) AS Count1,

SUM(CASE WHEN intValue = 2 THEN 1 ELSE 0 END) AS Count2,

SUM(CASE WHEN intValue = 3 THEN 1 ELSE 0 END) AS Count3,

SUM(CASE WHEN intValue = 4 THEN 1 ELSE 0 END) AS Count4,

SUM(CASE WHEN intValue = 5 THEN 1 ELSE 0 END) AS Count5

FROM               xrefTable

GROUP BY       idItem

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Purchase from House of Fusion, a Macromedia Authorized Affiliate and support the CF 
community.
http://affiliates.macromedia.com/b.asp?id=2439&p=go/fl_aff1

Message: http://www.houseoffusion.com/lists.cfm?link=i:6:1727
Archives: http://www.houseoffusion.com/lists.cfm?link=t:6
Subscription: http://www.houseoffusion.com/lists.cfm?link=s:6
Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=<:emailid:>.<:userid:>.<:listid:>

                        

Reply via email to