Possible Duplicate:
dynamic sql pivot in sql server
How to alter this stored procedure for PIVOT output
SELECT COUNT(Rly) AS TheCount, Rly FROM SPAD
WHERE Rly IN ('CR', 'ER', 'ECR', 'ECoR', 'NR', 'NCR', 'SR', 'SCR', 'SER', 'SECR', 'WR', 'WCR', 'Kolkata')
GROUP BY Rly
This ASSUMES that you have a finite number of rlys values; The only other current way to achieve this is to use DYNAMIC SQL if there are more values. (Searching for link)
EDITED After acceptance to change from count to sum.