Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories

Transpose from Select Statement

aarunlalaarunlal Member Posts: 95
How have a table with Given values

SLNO NAME

1 A
2 B
3 C
4 D

i want to Transpose the above datas in a Select statement.

SLNO 1 2 3 4
NAME A B C D

Please send me the select statement for this Task.

Hope you respond sooon.

regards
Arunlal

Comments

  • lionblionb Member Posts: 1,688 ✭✭
    : How have a table with Given values
    :
    : SLNO NAME
    :
    : 1 A
    : 2 B
    : 3 C
    : 4 D
    :
    : i want to Transpose the above datas in a Select statement.
    :
    : SLNO 1 2 3 4
    : NAME A B C D
    :
    : Please send me the select statement for this Task.
    :
    : Hope you respond sooon.
    :
    : regards
    : Arunlal
    :
    [code]
    SELECT SLNO, NAME FROM tblName
    WHERE (SLN0 BETWEEN 0 AND 5)
    AND (NAME IN ('A','B','C','D'))
    [/CODE]
    or
    [CODE]
    SELECT SLNO, NAME FROM tblName
    WHERE (SLNO > 0 AND SLN0 < 5)
    AND (NAME = 'A' OR NAME = 'B' OR NAME = 'C' OR NAME = 'D')
    [/CODE]



  • aarunlalaarunlal Member Posts: 95
    hi still it is wrong ?
    now also after select out put is comming like this.

    SLNO NAME

    1 A
    2 B
    3 C
    4 D


    i want look like this.

    SLNO 1 2 3 4
    NAME A B C D


    regards
    Arunlal





    : : How have a table with Given values
    : :
    : : SLNO NAME
    : :
    : : 1 A
    : : 2 B
    : : 3 C
    : : 4 D
    : :
    : : i want to Transpose the above datas in a Select statement.
    : :
    : : SLNO 1 2 3 4
    : : NAME A B C D
    : :
    : : Please send me the select statement for this Task.
    : :
    : : Hope you respond sooon.
    : :
    : : regards
    : : Arunlal
    : :
    : [code]
    : SELECT SLNO, NAME FROM tblName
    : WHERE (SLN0 BETWEEN 0 AND 5)
    : AND (NAME IN ('A','B','C','D'))
    : [/CODE]
    : or
    : [CODE]
    : SELECT SLNO, NAME FROM tblName
    : WHERE (SLNO > 0 AND SLN0 < 5)
    : AND (NAME = 'A' OR NAME = 'B' OR NAME = 'C' OR NAME = 'D')
    : [/CODE]
    :
    :
    :
    :

Sign In or Register to comment.