how to split single row into multiple columns in mysql

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • arulkumara
    New Member
    • Aug 2007
    • 15

    how to split single row into multiple columns in mysql

    Hi,

    I have one problem in mysql.
    how to split single row into multiple columns in mysql.
    my table structure:

    Code:
    id         salaryhigh salarymedium  salarylow
    **********************************************
    1           1000          100             1
    2           2000          200             2
    I need following output :

    Code:
    id      saldetails  description
    ***********************************
    2         1000       high  
              100        med
               1          low
    3        2000       high
              200        med
              2          low
  • r035198x
    MVP
    • Sep 2006
    • 13225

    #2
    Originally posted by arulkumara
    Hi,

    I have one problem in mysql.
    how to split single row into multiple columns in mysql.
    my table structure:

    Code:
    id         salaryhigh salarymedium  salarylow
    **********************************************
    1           1000          100             1
    2           2000          200             2
    I need following output :

    Code:
    id      saldetails  description
    ***********************************
    2         1000       high  
              100        med
               1          low
    3        2000       high
              200        med
              2          low
    You can concat the columns but I don't know if you can get them to show on multiple lines using MySQL only.

    Comment

    Working...