Column to return 2 rows

  • Good day!

    I have the following table

    Table1

    Col1    Col2

    10        INP

    22        OVL

    23        INP

    26        OVL

    28        INP

    I want my output to put all INP's in once column and all OVL in another, please help with select syntax

    Col1    Col2    Col3

    10      INP

    22                 OVL

    23      INP

    26                 OVL

    28      INP

  • select

    col1,

    col2 = case col2 when 'INP' then col2 end,

    col3 = case col2 when 'OVL' then col2 end

    from Table1

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

You must be logged in to reply to this topic. Login to reply