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!

merging rows in a single cell

Discussion in 'SQL PL/SQL' started by neelambhumij, Oct 6, 2014.

  1. neelambhumij

    neelambhumij Active Member

    Messages:
    51
    Likes Received:
    2
    Trophy Points:
    160
    Location:
    JOHANNESBURG
    Hi all

    I need a suggestion on sql

    iOn selecting a column for a single row give me multiple lines.
    I want to use sql query to make them into a single line..

    Example:
    select description
    from dept
    where dept_no=10

    output:
    dept no=10
    Description: Redler conveyor
    Contact Name: 111
    Revenue: Rs 600,000.00

    --The sql should make it like the following...
    dept no=10 Description: Redler conveyor Contact Name: 111Revenue: Rs 600,000.00


    Thanks and Kind Regards
     
  2. neelambhumij

    neelambhumij Active Member

    Messages:
    51
    Likes Received:
    2
    Trophy Points:
    160
    Location:
    JOHANNESBURG
    It is done..

    select replace ( description, chr(10),' ' ) FROM dept
    where where dept_no=10