• PIVOT will give you the results for each ID in one single row:

    if OBJECT_ID('tempdb..#temp') is not null

    drop table #temp

    create table #temp (id int, characteristic varchar(15), value nvarchar(15))

    insert into#temp

    select 1, 'color', 'blue'

    union all

    select 1, 'age', '5'

    union all

    select 1, 'gender', 'male'

    union all

    select 2, 'color', 'green'

    union all

    select 2, 'cost', '10.0'

    union all

    select 2, 'description', 'testing'

    union all

    select 3, 'age', '7'

    union all

    select 3, 'gender', 'female'

    union all

    select 3, 'description', 'something'

    select *

    from #temp

    pivot

    (max(value)

    for characteristic in (,[age],[gender],[cost],[description])

    ) as pvtTable

    if OBJECT_ID('tempdb..#temp') is not null

    drop table #temp

    Expand the list in "for characteristic in (,[age],[gender],[cost],[description])" with all possible options. In your sample data it is not completly clear what all values are, so that's up to you. When there is no row present for a specific characteristic a NULL value will be shown in the resultset.

    ** Don't mistake the ‘stupidity of the crowd’ for the ‘wisdom of the group’! **