Forum Replies Created

Viewing 2 posts - 1 through 2 (of 2 total)

  • RE: Urgent help needed to convert 100 rows into 100 columns

    thejask08 ... row_number() is just added to get an id so that we can loop the comany.

    so instead of the statemnet below ........

    Select Row_Number() Over(order by Company) Id, *...

  • RE: Urgent help needed to convert 100 rows into 100 columns

    for this create dynamic query. a loop that will create a pivot query.

    e.g.,

    Create table #t1

    (

    IdInt Identity(1,1),

    ProductVarchar(15),

    CompanyVarchar(15),

    StockInt

    )

    GO

    Insert into #t1

    Values('Pen', 'Renold', 100),

    ('Pen', 'Cello', 100),

    ('Pen', 'Lexi', 100)

    Select Row_Number() Over(order by Company) Id, *...

Viewing 2 posts - 1 through 2 (of 2 total)