• The following works, but in GRID mode you won't see it and in TEXT mode they won't line up under the Cities column.

    Create TABLE #tempCityState (State Varchar(5), City Varchar(50))

    Insert Into #tempCityState

    Select 'CO', 'Denver' Union

    Select 'CO', 'Teluride' Union

    Select 'CO', 'Vail' Union

    Select 'CO', 'Aspen' Union

    Select 'CA', 'Los Anggeles' Union

    Select 'CA', 'Hanford' Union

    Select 'CA', 'Fremont' Union

    Select 'AK', 'Wynne' Union

    Select 'AK', 'Nashville';

    --Select Distinct State, (Select Stuff((Select ',' + City

    --From #tempCityState

    --Where State = t.State

    --FOR Xml Path('')),1,1,'')) AS Cities

    --From #tempCityState t;

    with States as (

    select distinct

    State

    from

    #tempCityState

    )

    select

    State,

    stuff((select '' + City + char(13) + char(10)

    from #tempCityState tcs

    where tcs.State = States.State

    order by tcs.City

    for xml path(''),TYPE).value('.','varchar(max)'),1,0,'') as Cities

    from

    States;

    Drop table #tempCityState