1. Get rid of all advertisements and get unlimited access to documents by upgrading to Premium Membership. Upgrade to Premium Now and also get a Premium Badge!

Spilt colums to separt lines

Discussion in 'SQL PL/SQL' started by jhonnyrip, Jan 16, 2017.

  1. jhonnyrip

    jhonnyrip Active Member

    Messages:
    29
    Likes Received:
    1
    Trophy Points:
    90
    Location:
    lansing
    select min(TEST2_ID)||','||max(TEST2_ID)
    from test where TEST1_ID=13228194

    TEST1_ID TEST2_ID
    ---------- -----------------
    13228194,12022099

    would like see output like this

    13228194,
    12022099

    Thanks

    Jhonny
     
  2. zargon

    zargon Community Moderator Forum Guru

    Messages:
    2,567
    Likes Received:
    362
    Trophy Points:
    1,430
    Location:
    Aurora, CO
    I can only presume that you want one record on two lines which would require using chr(10) to get a newline between columns:

    Code (SQL):
    SELECT MIN(TEST2_ID)||','||chr(10)||MAX(TEST2_ID)
    FROM test WHERE TEST1_ID=13228194
    /

     
     
  3. jhonnyrip

    jhonnyrip Active Member

    Messages:
    29
    Likes Received:
    1
    Trophy Points:
    90
    Location:
    lansing
    super man and that's it

    Thanks