SQL Server Performance

T-SQL Query Help???

Discussion in 'Getting Started' started by sivakumar.sundaresan, Aug 11, 2007.

  1. Hi,
    Can I have the T-SQL query for the following scenario.
    I have a table with the following list of values and the desired output is as below :
    create table foo(c int)
    go
    insert into foo values (11)
    insert into foo values (27)
    insert into foo values (83)
    insert into foo values (24)
    go
    Desired output is as below:
    c1 c2
    --- ---
    11 27
    27 83
    83 24
    Many Thanks.
    -Siva
  2. ndinakar Member

    You need explain a little more as it not obvious from the data how you arrived at the result. Also, the improper formatting is confusing us further.
    Do you need to transform the rows into columns?
  3. Hi Dinakar,
    I have reposted the same.
    It is NOT the transformation of all the rows to columns.
    But the First and Second rows to be represented as two different columns on the First row , the second and the third rows to be represented on the second row and so on.....
    Please can I have the reply.
    -Siva
  4. satya Moderator

Share This Page