• Hope this too will work ,but while coming to performace related point of view hope this query will degrade.I have posted this because it may help someone in future.

    SELECT

    distinct c.grp,sum(amount) amt,

    ledger = REPLACE(

    ( SELECT

    ledger AS [data()]

    FROM

    sample s

    WHERE

    s.grp = c.grp

    FOR XML PATH ('')

    ), ' ', ',')

    FROM

    sample c group by c.grp

    Thanks

    Chandru