• I don't think you want or need a pivot for this. However to be able to answer your question you first need to help us understand the actual issue. We need to see ddl and sample data. I took a shot at creating those from what you posted.

    create table #Something

    (

    ID int,

    Product1 int,

    Product2 int,

    Product3 int

    )

    insert #Something

    select 1, 1, null, null union all

    select 2, 1, 2, null union all

    select 3, 3, 1, null union all

    select 4, 2, 3, 1

    So based on that sample data what should the output be?

    _______________________________________________________________

    Need help? Help us help you.

    Read the article at http://www.sqlservercentral.com/articles/Best+Practices/61537/ for best practices on asking questions.

    Need to split a string? Try Jeff Modens splitter http://www.sqlservercentral.com/articles/Tally+Table/72993/.

    Cross Tabs and Pivots, Part 1 – Converting Rows to Columns - http://www.sqlservercentral.com/articles/T-SQL/63681/
    Cross Tabs and Pivots, Part 2 - Dynamic Cross Tabs - http://www.sqlservercentral.com/articles/Crosstab/65048/
    Understanding and Using APPLY (Part 1) - http://www.sqlservercentral.com/articles/APPLY/69953/
    Understanding and Using APPLY (Part 2) - http://www.sqlservercentral.com/articles/APPLY/69954/