/*table tmp de test*/ DECLARE @T TABLE(c1 varchar(1), c2 varchar(35)); INSERT INTO @T VALUES('A', 'test'); INSERT INTO @T VALUES('A', 'test'); INSERT INTO @T VALUES('C', 'retest'); INSERT INTO @T VALUES('D', 'reretest'); INSERT INTO @T VALUES('C', 'retest'); SELECT c1, COUNT(c1+c2) FROM @T GROUP BY c1+c2, c1