wm_concat and order

When ran the following query, I got the enames unordered result. Does anyone know how to get the wm_concat to the order\sort column? I use oracle v10. Any thoughts are appreciated. Thank you.

Select distinct deptno, wm_concat (ename) over (partition by deptno arrested by deptno) as enames
WCP
Ename, deptno group
order by deptno

output current:
DEPTNO ENAMES 
10     MILLER,CLARK,KING 
20      SCOTT,JONES,FORD,ADAMS,SMITH 
30     MARTIN,JAMES,WARD,ALLEN,TURNER,BLAKE 
The target output:
DEPTNO ENAMES 
10     CLARK,KING,MILLER 
20      ADAMS,FORD,JONES,SCOTT,SMITH 
30     ALLEN,BLAKE,JAMES,MARTIN,TURNER,WARD
Wanwan

wm_concat is undocumented. so please do not use it. You can use the following query. It also solves your problem order.

select deptno, ltrim(sys_connect_by_path(ename,','),',')
  from (select deptno, ename, row_number() over(partition by deptno order by ename) rno
          from emp)
where connect_by_isleaf = 1
connect by deptno = prior deptno
  and rno = prior rno+1
start with rno = 1

Tags: Database

Similar Questions

  • Why the continuous measurement and Logging in LabVIEW 2012 Project uses strings instead of Enums and orders from the queue?

    Hello!

    I noticed that the continuous measurement and a project in LabVIEW 2012 Logging using chains instead of enums and orders from the queue. I wonder if there is a good reason for it?

    Kind regards

    Anguel

    First, string vs enum debate is probably the version of LabVIEW vim vs emacs. There are good arguments on both sides, and I doubt that there is always a "winner".

    A brief summary of our reasoning for the current state of the project examples:

    1. We used enums for the state machine because it is self-contained. A state machine will never tell himself to enter a State, he does not know. Knowing (as the programmer) all possible States with the help of an enum allows you to enlist the compiler in order to help us avoid mistakes to change the time (because you can't quite out an enum and LabVIEW can be said if you are not covering all cases to a structure of the case, etc..).

      Enums provide greater protection and rigidity by ensuring all withdrew at the time of publishing. This is often the 'default' recommendation that we do.

    2. We used strings for messages in queue manager because the producer of message and the message handler could be independent processes that are reused or traded. Channels avoid the need for the compiler to be able to connect the orders and push this responsibility to the programmer. This allows you to develop some sub-components independently as long as you agree to a series of channel commands that you can manage - you need not to share a file 'messages.ctl' or 'states.ctl '. It is conceivable a loop of message management a message it does not, how you can decide to either silently ignore it or will trigger an error (as we do in the model). The strings make it also easier if you want to swap the queues of LabVIEW outside by a TCP implementation for network vacilitate or intra-Processuse communication where the other end may or may not be written in LabVIEW.

      Channels to provide more flexibility (that is, you can add new commands to an existing via plugins system, you can pass parameters as part of the string, etc.) at the expense of pushing her potential errors at run time and to put more responsibility on the programmer.

    3. The actor's gifts frame a 3rd option - using classes such as messages. For me, it combines many of the advantages of these two enumerations (strictly typed, change errors) and strings (flexible and scalable), but with the disadvantage of being somewhat less transparent (you understand OO, be comfortable to navigate through a multitude of screws, legacy of understanding, etc.).

    I don't know there are other reasons, others to the breast OR had or seen as we validated models and examples of projects in-house, but here are my reasons. We know that we can not design for each situation there - our goal is to get useful models against new users to make them aware of what well thought LabVIEW programs are similar to experienced users know their applications better and I hope they do not hesitate to change what we provide or create their own designs, when they feel it's necessary. (On a side note, please share what you come up with - a community of experts sharing models would be really useful to us all LabVIEW users).

    Best regards

    Simon

  • drivers for my inspiron e1505, and order

    Need drivers and order for inspiron e1505

    douglasbrooksXB,

    Go to the Dell warranty status , enter your service tag, click the original configuration. Everything must be registered to know which video you and card wireless network. If you have an Intel card, install them before the other brand (if there is one. I know that on some models later, need Intel drivers installed before the nVidia drivers.

    I would install the Dell system software and chipset drivers.

    Then, install the ethernet drivers and your adapter wireless, followed by Dell Quickset. Then, you can get online to install video and audio drivers without problem.

    Rick

  • Recently ordered (and order confirmed) "Plan of creative photography of Cloud (one year). I want to cancel it, but during the procedure, I do not even the option "Cancel". How should I proceed?

    Recently ordered (and order confirmed) "Plan of creative photography of Cloud (one year). I want to cancel it, but during the procedure, I do not even the option "Cancel". How should I proceed?

    In order to cancel the order, please contact customer service

    You can use: http://helpx.adobe.com/x-productkb/global/phone-support-orders.html

    For more information on cancellation: cancel your creative cloud membership

  • HELP ME IN CHARGE OF THE ELEMENTS 13 HAVE SERIAL NUMBER AND ORDER NUMBER

    ABDEL

    I NEED HELP TO DOWNLOAD ITEMS 13 HAVE SER NUMBER AND ORDER NUMBER

  • Flow of work and order reports

    Hello.

    I'll put up a site of fresh produce from small e-commerce site. I have a workflow problem. The site is intended as a sale chanel for different farmers. Each farm products have their a catalog (and sub catalogues). I have 2 problems.

    1. How can I configure the workflow - I would like the system to notify the farmer when users produced good order its catalog. I can do this whith the option of provider in product description settings?

    2. how to export a report for orders just for a catalog of farmers. I have problems with the exported reports. I need reports not only note wich customer something orderd but what he ordered and in what quantaties, thus. Is it still possible?

    TNX

    How can I configure the workflow - I would like the system to notify the farmer when users produced good order its catalog. I can do this whith the option of provider in product description settings?

    Yes. You enable drop shipping. See this article for details http://kb.worldsecuresystems.com/837/cpsid_83718.html

    How to export a report for orders just for a catalog of farmers. I have problems with the exported reports. I need reports not only note wich customer something orderd but what he ordered and in what quantaties, thus. Is it still possible?

    Try the customers and orders report, but would not be possible. You may need to implement an application that connect via API, pull on e-commerce and CRM data and produce this report for you. See this article for details http://kb.worldsecuresystems.com/635/bc_635.html API

    m

  • List of Finder application and orders

    For years I used a hotkey on the command "paste and Match formatting."  It is useful in applications such as Word and Mail.  This command does not appear in the Edit menu and I remember more where I found it.  I was therefore wondering if there is somewhere a list of orders.  I would like to browse and look for other more useful.

    You can find the list of commands in the article: Mac - Apple Support keyboard shortcuts

    Thank you!

  • Find all entries in address books and order in descending order

    I have an address book called Christmas. I don't seem to see the list of all my address books. When I find them I wish to see the names in descending order from a - z, please

    Open your address book.
    VIEW - put page to ensure that the two component directory and contact component is checked.

    Then select your address book, mode - SORT BY, and then select descending or ascending your preference.

    If this does not work, maybe download a picture of what it looks like to (smudge addresses for privacy).

  • I got a photo book, but I can't listen to samples and order?

    I have finished a photo book with opening 3.6, but when I try to preview, the application breaks down and I have to force quit so I can't order and purchase my book.

    I have an IMac at the end of 2013 with a 2'9 GHz processor intel core i5, so I don't think that's the problem.

    Anyone know what could be the problem and how to fix it?

    Thank you

    I have finished a photo book with opening 3.6, but when I try to preview, the application breaks down and I have to force quit so I can't order and purchase my book.

    Your book can contain a picture or a card that cannot be returned. You will need to identify the problematic item and delete it and replace it.

    Fact the crashlog list the filename of the picture that is being processed?  Look at the error message if you see no indication on the problematic photo.

    You can also try to identify the problematic element by duplicating the book.

    Select the book in the inspector from the photo library, ctrl-click, select 'duplicate the book. "

    Make two copies of the book. From the first copy remove half of the pages, the second ice the other half of the pages.

    Try to view the two copies of the book. If the opening hangs to one of the copies, the problematic element is this copy.

    Continue duplicating the copy of the book that keeps crashing and deleting pages, until you have found the page that is the cause of the crash.

    Then try to identify the photo or the map on the page which is the cause of the crash.

    Wich version of Aperture do you use?  If you are using version 3.4.5 opening or earlier, cards won't work any longer.

  • Hi blackBerry smartphones. I'm trying to contact technical support on and order...

    Hello. I am trying to contact support on and to order, I made (removing personal information). I go into my blackberry PIN # (remove personal information), but he says that's not a valid PIN #. That makes no sense. in any case, I had to re - install this app (Aerize alerts), so I need the serial code sent again to me. Thank you!

    Hello!

    To reinstall your applications, please follow this section of the AppWorld user guide:

    http://NA.BlackBerry.com/eng/deliverables/7268/re-install_an_item_on_a_different_device_643962_11.js...

    For more information, registration keys, see this KB:

    http://www.BlackBerry.com/BTSC/KB18646

    If this does not work, then please come back on these forums (http://supportforums.blackberry.com/rim/) and create an account so that we can provide direct assistance.

    See you soon!

  • Rownum and order of columns not indexed

    Why ROWNUM continue to take the same cost?

    Why can't you see no difference between the ORDER of SORTING BY STOPKEY and just SORT ORDER BY?

    SQL_ID, 9vccbf2dtazuq, number of children 0

    -------------------------------------

    Select * from (select * from PROCESS_MESSAGE by id) where

    rownum < 101

    Hash value of plan: 2507589572

    ------------------------------------------------------------------------------------------------------

    | ID | Operation | Name               | Lines | Bytes | TempSpc | Cost (% CPU). Time |

    ------------------------------------------------------------------------------------------------------

    |   0 | SELECT STATEMENT |                    |       |       |       |  1252K (100) |          |

    |*  1 |  COUNT STOPKEY |                    |       |       |       |            |          |

    |   2.   VIEW                  |                    |    26 M |    40G |       |  1252K (1) | 00:00:49 |

    |*  3 |    SORT BY STOPKEY ORDER.                    |    26 M |  4736M |  5835M |  1252K (1) | 00:00:49 |

    |   4.     TABLE ACCESS FULL | PROCESS_MESSAGE |    26 M |  4736M |       |   170K (1) | 00:00:07 |

    ------------------------------------------------------------------------------------------------------

    Information of predicates (identified by the operation identity card):

    ---------------------------------------------------

    1 - filter(ROWNUM<101)

    3 - filter(ROWNUM<101)

    SQL_ID, 2zwdanc062902, number of children 0

    -------------------------------------

    Select * from PROCESS_MESSAGE by id

    Hash value of plan: 1046773234

    -------------------------------------------------------------------------------------------------

    | ID | Operation | Name               | Lines | Bytes | TempSpc | Cost (% CPU). Time |

    -------------------------------------------------------------------------------------------------

    |   0 | SELECT STATEMENT |                    |       |       |       |  1252K (100) |          |

    |   1.  SORT ORDER BY |                    |    26 M |  4736M |  5835M |  1252K (1) | 00:00:49 |

    |   2.   TABLE ACCESS FULL | PROCESS_MESSAGE |    26 M |  4736M |       |   170K (1) | 00:00:07 |

    -------------------------------------------------------------------------------------------------

    Cost is not something that I want to live. Here's a simple example. Search for the-row, A-Time and memory usage for the SORT operation on both the query to see the difference.

    Connected to:
    Oracle Database 10g Enterprise Edition Release 10.2.0.5.0 - 64bit Production
    With the Partitioning, OLAP, Data Mining and Real Application Testing options
    
    SQL> create table t as
      2  select rpad ('x', 1000, 'x') str from dual
      3  connect by level <= 10000;
    
    Table created.
    
    SQL> exec dbms_stats.gather_table_stats(user, 'T')
    
    PL/SQL procedure successfully completed.
    
    SQL> alter session set statistics_level = all
      2  ;
    
    Session altered.
    
    SQL> @temp.txt
    
    PLAN_TABLE_OUTPUT
    -------------------------------------------------------------------------------------------------------------------------------------------------------------------------
    SQL_ID  c4qj1q3h9kkyy, child number 0
    -------------------------------------
    select * from t order by str
    
    Plan hash value: 3672837129
    --------------------------------------------------------------------------------------------------------------------------------------------------------
    | Id  | Operation          | Name | Starts | E-Rows |E-Bytes|E-Temp | Cost (%CPU)| E-Time   | A-Rows |   A-Time   | Buffers |  OMem |  1Mem | Used-Mem |
    --------------------------------------------------------------------------------------------------------------------------------------------------------
    |   0 | SELECT STATEMENT   |      |      1 |        |       |       |  2018 (100)|          |  10000 |00:00:00.25 |    1433 |       |       |          |
    |   1 |  SORT ORDER BY     |      |      1 |  10000 |  9775K|     9M|  2018   (1)| 00:00:20 |  10000 |00:00:00.25 |    1433 |    11M|  1285K|    9M (0)|
    |   2 |   TABLE ACCESS FULL| T    |      1 |  10000 |  9775K|       |   225   (1)| 00:00:03 |  10000 |00:00:00.02 |    1433 |       |       |          |
    --------------------------------------------------------------------------------------------------------------------------------------------------------
    
    14 rows selected.
    
    PLAN_TABLE_OUTPUT
    -------------------------------------------------------------------------------------------------------------------------------------------------------------------------
    SQL_ID  8a53npuzuxxj5, child number 0
    -------------------------------------
    select * from (select * from t order by str) where rownum <= 50
    
    Plan hash value: 1317717595
    -------------------------------------------------------------------------------------------------------------------------------------------------------------
    | Id  | Operation               | Name | Starts | E-Rows |E-Bytes|E-Temp | Cost (%CPU)| E-Time   | A-Rows |   A-Time   | Buffers |  OMem |  1Mem | Used-Mem |
    -------------------------------------------------------------------------------------------------------------------------------------------------------------
    |   0 | SELECT STATEMENT        |      |      1 |        |       |       |  2018 (100)|          |     50 |00:00:00.08 |    1433 |       |       |          |
    |*  1 |  COUNT STOPKEY          |      |      1 |        |       |       |            |          |     50 |00:00:00.08 |    1433 |       |       |          |
    |   2 |   VIEW                  |      |      1 |  10000 |  4902K|       |  2018   (1)| 00:00:20 |     50 |00:00:00.08 |    1433 |       |       |          |
    |*  3 |    SORT ORDER BY STOPKEY|      |      1 |  10000 |  9775K|     9M|  2018   (1)| 00:00:20 |     50 |00:00:00.08 |    1433 | 61440 | 61440 |55296  (0)|
    |   4 |     TABLE ACCESS FULL   | T    |      1 |  10000 |  9775K|       |   225   (1)| 00:00:03 |  10000 |00:00:00.01 |    1433 |       |       |          |
    -------------------------------------------------------------------------------------------------------------------------------------------------------------
    
    Predicate Information (identified by operation id):
    ---------------------------------------------------
       1 - filter(ROWNUM<=50)
       3 - filter(ROWNUM<=50)
    
    22 rows selected.
    

    Edited...

    Looking for more, if you see the lines-E in the second request its 10000 for SORTING display. But the row that is the true value is 50. Maybe this could be a factor why the cost of both the request are the same.

  • generation of sequence using rownum and order of

    Hi all

    Need to generate a sequence number based on a column value in a table.

    When you try to insert into a table by using the order by and rownum, I am not able to do the same thing.

    Here is a simple example to show this... need help how to insert a sequence field in the base table a column value...

    create table test1(col1 number);
    
    
    insert into test1 values(1);
    insert into test1 values(2);
    
    
    
    
    insert into test1 values(4);
    insert into test1 values(3);
    

    select * from test1;
    

    1

    2

    4

    3

    Now, I'm trying to insert into test1 values-based test2:

    create table test2(col1 number,seq number);
    
    
    insert into test2 (select col1,rownum from test1  order by col1 asc);
    

    ORA-00907: lack of right parenthesis

    So I tried with:

    insert into test2 select col1,rownum from test1  order by col1 asc;
    

    It worked, but the sequence is not generated according to the ranking...

    COL1SEQ

    11
    22
    34
    43

    can someone please help...

    Thanks in advance...

    MRK...

    Another way would be to use analytical functions. These have the advantange of being independent of the order of... in fact, you could use serveral where everyone has his own sort.

    Select col1

    row_number() over (order by col1 CSA) seq_asc

    row_number() over (order by col1 desc) seq_desc

    of test1

  • Check the status of the order and order # confirmation e-mail has not been found.

    Hello

    having my order with my confirmation number but when I check the status of the online order, the order number in the email was not valid you are invited by the site.

    Please help.

    Thank you and best regards,

    Celine

    It could be a problem of activation.

    Please see the below help documents:

    Applications creative Cloud back in test mode after an update until 2015 for CC

    Solutions to connection errors, activation and connection with creative Cloud applications and Creative Suite

  • Which component creates by default profile and order objects?

    Hi all

    As we know that whenever we visit the shopping page online, a default profile object and the Order object are created. Can you please tell me what component creates these objects?

    These objects even though the home page is a static page?

    Creation of ATG profile:

    Only the profile will be created whenever we visit any page in Application of ATG.

    ProfileCreation enters the servlet pipeline "ProfileRequestServlet", so for any request if the profile does not exist, it will create the profile.

    But it is also possible to avoid the creation of profile by registering only not in the servlet pipeline string. Execution of the servlet pipeline coming with the help of pagefilter for jsp.

    So using the page filter you can avoid him. IE not let all the jsps through PageFilter.

    Page filters are defined in the web.xml file.

    PageFilter

    atg.filter.dspjsp.PageFilter

    PageFilter

    *.jsp

    Order of creation in the ATG

    There may be several points of outbreak of the order is first created.

    • When we add point to order using OOTB form of management methods, if the order is not output, ATG will create an order object and add this item in the agenda.
    • At any time, if one refers to the ShoppingCart component, if there is no order, ATG will create an order.

    Kind regards

    Nitin.

  • Subselect with Rownum and Order By

    Good morning, people, I'm trying to do some Firebird SQL work in Oracle and there is something that I can't find an easy way to deal with:

    CUSTOMER has many RECIPES, let's say I want the ID of the last receipt of a customer...

    That's how it's done in FB:

    SELECT

    c.ID, c.name,

    (SELECT FIRST r.id 1

    RECEPTION r

    WHERE r.customer_id = c.id

    ORDER BY r.creation_date DESC) as LAST_RECEIPT_ID

    CUSTOMER c

    It's simple and works like a charm... the subselect statement will order first of all, the most recent reception will be the first line, then I use to avoid any error 'select several lines in singleton' a 'first 1 ", equivalent to rownum = 1;

    If I try this with Oracle it won't work:

    SELECT

    c.ID, c.name,

    (SELECT r.id

    RECEPTION r

    WHERE r.customer_id = c.id

    AND rownum = 1

    ORDER BY r.creation_date DESC) as LAST_RECEIPT_ID

    CUSTOMER c


    What is the best way to achieve the same in Oracle?

    SELECT c.id
    ,      c.name
    ,      (SELECT MAX(r.id) KEEP (DENSE_RANK FIRST ORDER BY r.creation_date DESC) last_receipt_id
            FROM   receipt r
            WHERE  r.customer_id = c.id) as last_receipt_id
    FROM customer c;
    

Maybe you are looking for

  • Looking for iPod in iTunes 12?

    Hello, I need to know why ITunes 12 will NOT search for what's on the iPod? The ipod is plugged in and ITunes sees it, but when I go to the research I can find in my library or the Itunes store, but not what's inside my ipod? I don't want to copy my

  • I cannot reset my new tab window and do not want the one I have. How can I fix it?

    When I open a new tab, it immediately pulls me to a search site called 'trozi '. I looked for a solution throughout the morning and nothing helped. I tried to go into the menu and reset the values, I completely reset firefox, I tried to disable modul

  • I had bookmarked before I left the system; now they are gone, how to make their comeback?

    How can I fix it?

  • Tektronix AFG 3102 error

    Hello What does this error mean? -410, 'INTERRUPT request '. I am using Tektronix AFG 3102 with GPIB and a few screws of the internet. It keeps popping up without reason. I'm new to this so if you could explain slowly and explain technical terms, I w

  • Play media files

    Hello. I want to create an application in which I need to play a media file (audio files), which is recorded in the application file. After going through the web, I found only the media playback using "Media Player" to play from a server (download an