• ;WITH SampleData AS (

    SELECT CId = 1, CCId = 'a', CCount = 3, totalCount = 6 UNION ALL

    SELECT 1, 'a', 3, 6 UNION ALL

    SELECT 1, 'b', 3, 6 UNION ALL

    SELECT 1, 'c', 3, 6 UNION ALL

    SELECT 2, 'b', 2, 6 UNION ALL

    SELECT 2, 'b', 2, 6 UNION ALL

    SELECT 2, 'a', 2, 6 UNION ALL

    SELECT 2, 'a', 2, 6 UNION ALL

    SELECT 3, 'v', 1, 6

    )

    SELECT

    CId,

    CCId,

    CCount,

    totalCount = SUM([First]) OVER (PARTITION BY (SELECT NULL))

    FROM (

    SELECT *,

    [First] = CASE WHEN 1 = ROW_NUMBER() OVER(PARTITION BY CId ORDER BY CCId) THEN CCount END

    FROM SampleData

    ) d

    “Write the query the simplest way. If through testing it becomes clear that the performance is inadequate, consider alternative query forms.” - Gail Shaw

    For fast, accurate and documented assistance in answering your questions, please read this article.
    Understanding and using APPLY, (I) and (II) Paul White
    Hidden RBAR: Triangular Joins / The "Numbers" or "Tally" Table: What it is and how it replaces a loop Jeff Moden