Merging multiple lines into only one separeted by \n

Hello,
I have a query that returns some lines as result, instead of return lines, I want to return just one line separated by \n...
For example:
select 'name 1' as name from dual
union
select 'name 2' as name from dual
union
select 'name 3' as name from dual
The query above returns:
name1
name2
name3
What I need is:
name1\nname2\nname3
How could I solve this?
Thanks

in 10g,
SQL> WITH T
  2       AS (SELECT 'name 1' AS NAME FROM DUAL
  3           UNION
  4           SELECT 'name 2' AS NAME FROM DUAL
  5           UNION
  6           SELECT 'name 3' AS NAME FROM DUAL)
  7  SELECT REGEXP_REPLACE ( SYS_CONNECT_BY_PATH ( NAME, '\n'), '^\\n') AS new_name
  8    FROM (SELECT NAME, ROW_NUMBER () OVER (ORDER BY NAME) rn FROM T)
  9   WHERE CONNECT_BY_ISLEAF = 1
10  START WITH rn = 1
11  CONNECT BY rn = PRIOR rn + 1;
NEW_NAME
name 1\nname 2\nname 3
SQL> in 11g,
SQL> WITH T
  2       AS (SELECT 'name 1' AS NAME FROM DUAL
  3           UNION
  4           SELECT 'name 2' AS NAME FROM DUAL
  5           UNION
  6           SELECT 'name 3' AS NAME FROM DUAL)
  7  SELECT listagg ( NAME, '\n') WITHIN GROUP (ORDER BY NAME) as new_name
  8    FROM T;
NEW_NAME
name 1\nname 2\nname 3
SQL>

Similar Messages

  • Text issues merging multiple pdfs into one pdf

    Hello, when I merge multiple pdfs into one pdf document my text is missing or garbled.  I spent hours yesterday trying to figure this out, from insuring the text was embedded and print setting were correct.  Please help!!
    Using Adobe Pro 9.0
    Thanks,
    Faith

    Acrobat Pro is the application you use for working with PDFs, making minor edits, combining multiple PDFs into a single file, extracting or replacing pages, doing fancier form work than ID has the ability to produce, and even creating PDF from a number of other file formats. I'm not sure your question about maintaining the quality of your photos is really applicable -- it would depend on how youare getting from the photo to PDF to begin with. The use of Acrobat in and of itself won't be the determiner.
    That said, I couldn't live without Acrobat Pro in my workflow. Since you are on CS5.5 you have a couple of options. You could purchase a subscription to Creative Cloud (at a discount for the first year), which would give you access not only to Acrobat, but all of the other programs and tools included in the suite, but you pay a monthly or yearly fee, or you can buy a standalone perpetual license to either Acrobat Pro or Acrobat Standard (I didn't realize Standard was still an option, and you might not need all the features of Pro -- you can compare at http://www.adobe.com/products/acrobatpro/buying-guide.html).

  • I have 3 iTunes accounts and want to merge them into only one of them. I also have money on all 3 accounts

    I have 3 iTunes accounts and want to merge them into only one of them. I also have money on each account. Not sure how to go about this.

    You cannot merge the accounts.
    Sorry.

  • Merge multiple pictures into one picture like Photoscape?

    Looking for imac software like Photoscape which can merge multiple pictures into one.  Thanks!

    PhotoShop Elements is a good one
    LN

  • Merge multiple spools into a new big spool (OTF) ???

    Hi.
    I just want to know how to merge multiples otf (or spool) into a new big spool.
    All OTF are starting with something like that:
    //XZSIMM       046B 0000000000
    IN01FZVINVOICE_BPB01 FIRST
    OPDINA4   P 144  240 1683811906000010000100000
    When changing page we got a:
    EP
    All OTF are terminated with a EOF symbol:
    How can i merge these OTF ????
    Should I remove all // except the last one ?
    I tried to remove the first line and the last line of each OTF but it doesn't work.
    Please help me.
    Message was edited by:
            fabien couedel

    Hi Fabien,
    Here is the solution to merge multiple OTF data....
    EP is the command which indicates end of page.
    Suppose the two OTF data are like this:
    //  XHPLJIIID         0620    00000000001
    IN 04EZSHAIL_SMFORM1
    IN 05%PAGE1
    OP DINA4     P   144   240   3495731000100289301000
    IN 06MAIN
    EP
    //  XHPLJIIID         0620     00000000001
    IN 04EZSHAIL_SMA1
    IN 05%PAGE1
    OP DINA4   P   144   240   238974761890001001100010
    IN 06MAIN
    EP
    The merged OTF should be like this:
    //  XHPLJIIID         0620    00000000001
    IN 04EZSHAIL_SMFORM1
    IN 05%PAGE1
    OP DINA4     P   144   240   3495731000100289301000
    IN 06MAIN
    EP
    IN 04EZSHAIL_SMA1
    IN 05%PAGE1
    OP DINA4   P   144   240   238974761890001001100010
    IN 06MAIN
    EP
    The idea is like this:
    Each OTF data has to begin and end with '//'.
    Each page should end with 'EP'.
    So, to merge multiple OTF data, after each EP command, append the data
    part of each OTF data.(DON'T INCLUDE THE FIRST LINE ie: // XHPLIIID ....)
    This is how you merge multiple OTF data to one OTF data...
    <b>Award points if found useful.</b>
    Regards,
    SP.

  • How can I have multiple accounts and only one library

    How can I have multiple accounts and only one library that all the purchased items feed into?

    ask your wireless provider.

  • Multiple page  in only one pdf in adobe forms abap?

    Hi,
    How to display multiple page  in only one pdf in adobe forms abap and avoid > sign in adobe for next page?

    Hi,
    Here are the steps how you can do it.
    1. Create a table.
    2. In the Library palette, click the Standard category and drag the Table object into a cell in the main table.
    Note: If you selected Donu2019t Show This Again in the Insert Table dialog box, when you select the Table object from the Library palette, LiveCycle Designer automatically inserts a table with the same number of columns and rows that you inserted the last time you used the Insert Table dialog box.
    3. In the Insert Table dialog box, enter the number of columns and rows. You can enter a maximum of 20 columns and 50 rows. You can add more columns and rows after the table is created by using the Insert commands on the Table menu.
    4. To add a header row, select Include Header Row In Table.
    5. To add a footer row, select the Include Footer Row In Table.
    6. Click OK.
    Regards
    Runal

  • __Is there a way to 'merge' multiple curves into a single curve?

    __Is there a way to 'merge' multiple curves into a single curve?
    By this I mean I have file with 2-12 curve layers - I wanted to 'merge' the curves so that I can end up with a single curve with the attributes of many. Maybe is there a script that would do this?

    I don't mean to be critical, but how do you get to a situation where you have 12 successive Curves layers?
    The advantage to a Curves layer is that you can adjust and re-adjust it to your heart's content.
    If you're habitually adding new Curves layers one over the other, maybe you should re-evaluate your process of working...  Perhaps the way you're thinking you should just work at a high bit depth and do repeated Curves operations on the pixels?  Or put some time into retraining yourself to not add a new Curves layer but to manipulate the one that's already there.  There are some nice new enhancements (e.g., the "finger" subtool that allows you to choose a spot in the image and manipulate that part of the curve).
    Again, I'm not trying to criticize you, just looking to see if maybe there's a way to avoid getting to the point where you need to combine Curves in the first place, since there's no direct "Merge Curves" capability, outside of just stamping a set of image and adjustment layers into pixels.  For completeness I suppose I should mention how to do that...  You can Stamp any combination of visible layers into a single layer of pixels (effectively combining all the Curves layers et. al.) by pressing Control - Shift - Alt - E.
    -Noel

  • Merge multiple rows into single row (but multiple columns)

    How to merge multiple rows into single row (but multiple columns) efficiently.
    For example
    IDVal IDDesc IdNum Id_Information_Type Attribute_1 Attribute_2 Attribute_3 Attribute_4 Attribute_5
    23 asdc 1 Location USA NM ABQ Four Seasons 87106
    23 asdc 1 Stats 2300 91.7 8.2 85432
    23 asdc 1 Audit 1996 June 17 1200
    65 affc 2 Location USA TX AUS Hilton 92305
    65 affc 2 Stats 5510 42.7 46 9999
    65 affc 2 Audit 1996 July 172 1100
    where different attributes mean different thing for each Information_type.
    For example for Information_Type=Location
    Attribute_1 means Country
    Attribute_2 means State and so on.
    For example for Information_Type=Stats
    Attribute_1 means Population
    Attribute_2 means American Ethnicity percentage and so on.
    I want to create a view that shows like below:
    IDVal IDDesc IDNum Country State City Hotel ZipCode Population American% Other% Area Audit Year AuditMonth Audit Type AuditTime
    23 asdc 1 USA NM ABQ FourSeasons 87106 2300 91.7 46 85432 1996 June 17 1200
    65 affc 2 USA TX AUS Hilton 92305 5510 42.7 46 9999 1996 July 172 1100
    Thanks

    Hi,
    That's called Pivoting . The forum FAQ has a section on this subject: {message:id=9360005}
    I hope this answers your question.
    If not, post your best attempt, along with a little sample data (CREATE TABLE and INSERT statements, relevant columns only), and also post the results you want from that data. (You did post the results you wanted, but they're very hard to read because they're not formatted. Use \ tags, as described in the forum FAQ, below.)
    Explain, using specific examples, how you get the results you want from the data given.
    Always say which version of Oracle you're using (e.g., 11.2.0.2.0).  This is always important, but especially so with pivots.
    See the forum FAQ {message:id=9360002}                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           

  • I have two iTunes accounts, one for music and another for audiobooks.  I want to merge them and maintain only one iTunes account.  How do I do it?

    I have two iTunes accounts, one for music and another for audiobooks.  I want to merge them and maintain only one iTunes account.  How do I do it?

    You cannot.

  • Msg 116, Level 16, State 1, Line 6 Only one expression can be specified in the select list when the subquery is not introduced with EXISTS.

    Hello,
    Can anyone help me?
    select year(po.rdata) as 'Ano', 
    sum(etotal) as 'Valorp' ,
    (select year(fo.data),Sum(etotal) 
    FROM fo (nolock) 
    where  not exists ( select 1 from pl (nolock) where pl.adoc = fo.adoc and pl.cm = fo.doccode ) 
    group by year(fo.data))as 'Valorap'   
    from po 
    group by year(po.rdata)
    order by year(po.rdata)
    Error 
    Msg 116, Level 16, State 1, Line 6
    Only one expression can be specified in the select list when the subquery is not introduced with EXISTS.
    Consultora

    Hi Prashanth,
    select year(po.rdata) as 'Ano',
    sum(etotal) as 'Valorp' ,
    (select Sum(etotal)
    FROM fo (nolock)
    where not exists ( select 1 from pl (nolock) where pl.adoc = fo.adoc and pl.cm = fo.doccode )
    group by year(fo.data))as 'Valorap'
    from po(nolock)
    group by year(po.rdata)
    order by year(po.rdata)
    Gives me the error: 
    Msg 512, Level 16, State 1, Line 1
    Subquery returned more than 1 value. This is not permitted when the subquery follows =, !=, <, <= , >, >= or when the subquery is used as an expression.
    Thanks
    Consultora

  • The 'Access-Control-Allow-Origin' header contains multiple values '*, *', but only one is allowed. Origin 'null' is therefore not allowed access.

    Hello. I added custom http response headers to my SP site web config file as follows: 
    <httpProtocol>
          <customHeaders>
                 <add name="Access-Control-Allow-Methods" value="POST,GET,OPTIONS" />
          <add name="Access-Control-Allow-Origin" value="*" />
          <add name="Access-Control-Allow-Headers" value="Content-Type,Authorization" />
          </customHeaders>
        </httpProtocol>
    When I try to call any web service, i get these headers two times each: 
    HTTP/1.1 200 OK
    Cache-Control: private, max-age=0
    Transfer-Encoding: chunked
    Content-Type: application/atom+xml;type=entry;charset=utf-8
    Expires: Sat, 01 Mar 2014 19:11:37 GMT
    Last-Modified: Sun, 16 Mar 2014 19:11:37 GMT
    ETag: "3"
    X-SharePointHealthScore: 0
    SPClientServiceRequestDuration: 20
    SPRequestGuid: b4e77d9c-bfc3-a050-493a-ca5d251d1a72
    request-id: b4e77d9c-bfc3-a050-493a-ca5d251d1a72
    X-FRAME-OPTIONS: SAMEORIGIN
    Persistent-Auth: true
    Access-Control-Allow-Methods: POST,GET,OPTIONS
    Access-Control-Allow-Origin: *
    Access-Control-Allow-Headers: Content-Type,Authorization
    X-AspNet-Version: 4.0.30319
    X-Powered-By: ASP.NET
    Access-Control-Allow-Methods: POST,GET,OPTIONS
    Access-Control-Allow-Origin: *
    Access-Control-Allow-Headers: Content-Type,Authorization
    MicrosoftSharePointTeamServices: 15.0.0.4569
    Date: Sun, 16 Mar 2014 19:11:37 GMT
    and that gives me error from ajax: The 'Access-Control-Allow-Origin'
    header contains multiple values '*, *', but only one is allowed. Origin 'null' is therefore not allowed access.
    The 'Access-Control-Allow-Origin' header contains multiple values '*, *', but only one is allowed.
     Origin 'null' is therefore not allowed access.
    Any idea???

    Hi Ann,
    Please check whether there are duplicate custom headers in your code.
    Similar issue for your reference:
    http://social.msdn.microsoft.com/Forums/office/en-US/b79b75f4-b46b-46ae-ae29-17a352b6b90b/custom-http-response-headers-for-sp-2013-shown-2-times?forum=sharepointdevelopment 
    Regards,
    Rebecca Tu
    TechNet Community Support

  • Talking amongst multiple computers with only one .mac acct

    We have multiple computers but only one .mac account. We would like to isight/ichat with our home-based computers from our laptops (ie: talk with the kids at home while we're on the road...) but can't figure out how to make it work. Do we need to set up SEPARATE .mac accounts ("Family Plan") in order to isight/ichat amongst our computers or can we arrange it all, using only one account?

    Magpie is right.
    You can get FREE AIM Name(s) here.
    You can also get additional free dot mac names if you like. The names will continue to work as iChat names after the free trial (and other dot mac features) expire.

  • I have my ipod backed up on multiple computers but only one recognizes all my playlists.  How can I get all my play lists to show up on multiple computers?

    I have my ipod backed up on multiple computers but only one computershows all my playlists.  How can I get all my play lists to show up on multiple computers?

    If you want to connect and use an iPod on more than one computer you need to change the update preference in the iPod Summary tab to "Manually manage music and videos" and click Apply.
    Using iPod with Multiple computers
    Managing content manually on iPod
    If your iPod is set to update automatically take care when connecting to a different computer if your current one is out of commission. You will get a message that your iPod is linked to a different library and asking if you want to link to this one and replace all your songs etc, press "Cancel". Pressing "Erase and Sync" will irretrievably remove all songs from your iPod. Your iPod should appear in the iTunes source list from where you can change the update setting to manual and use your iPod without the risk of accidentally erasing it.

  • Concatenate multiple lines into one

    Post Author: [email protected]
    CA Forum: General
    Hi,I'm trying to pull data out of one table that could have multiple lines (indicated by a line count field for each row).  The user wants to see all lines in one field only.  I tried the following but am running into issues if there's only one row (one line count). With this, the single row is concatenated with itself. //@groupheader-initilizewhileprintingrecords;stringvar x:=""//@detailwhileprintingrecords;stringvar x:=x+ //@groupfooterwhileprintingrecords;stringvar x Any ideas appreciated.  Thanks!

    Post Author: Charliy
    CA Forum: General
    Take the initialize formula out of the Group Header.
    Place it an the Report Header, and create a second (print suppressed) Group Footer and place it there

Maybe you are looking for

  • How to use/sync single data (file) across multiple instances of same application

    Currently we have an application (a diagram editor), that have the ability to save and load (serialize) its state in a xml file. Now we want this application to behave like Microsoft OneNote application. Where multiple users have the ability to acces

  • HT4137 If you backup your phone is that the same as sync

    MY husband just bought the iPhone 5 and currently has the 4 if I have his 4 backed up on the computer does the phone still need to sync to save everything? Our main concern is him losing his contacts because of work. The phone does sync but only goes

  • What's the best way to add a new iphone to family itunes?

    We just bought a second iphone for my wife.  It was set up with her own apple id.  It looks like the family sharing for itunes requires a common apple id.  What's the best way to share the family music library with her new device? Thanks

  • How to see class/characteristics of measuring points in list editing screen

    Dear Sirs, I have created meauring points for several functional locations.These measuring points have been assigned classes and characteristics. How can I see these charactristics against measuring points in list edition screen(ALV Grid). Thanks and

  • MessageTextInput Behavior Question:

    Good Morning, On the messageTextInput tag, if you use the model attribute along with the name attribute and do a commit via the actionContext, the db column is not updated. If you remove the name attribute the column is updated. Why is this? Thanks