Concatenate using SQL rather than Oracle functions Oracle 8i

Is it possible to concatenate field values using SQL alone and not an Oracle function
For the following dataset I would like the results to be the following
1 User_lastname1 2,7
2 User_lastname2 2,7
3 User_lastname3 2
4 User_lastname4 7
CREATE TABLE users
( user_id NUMBER(10)
, user_lastname VARCHAR2 (50)
, workgroup NUMBER(10)
INSERT ALL
INTO users(user_id, user_lastname, workgroup) VALUES (1, User_lastname1, 2)
INTO users(user_id, user_lastname, workgroup) VALUES (1, User_lastname1, 7)
INTO users(user_id, user_lastname, workgroup) VALUES (2, User_lastname2, 2)
INTO users(user_id, user_lastname, workgroup) VALUES (2, User_lastname2, 7)
INTO users(user_id, user_lastname, workgroup) VALUES (3, User_lastname3, 2)
INTO users(user_id, user_lastname, workgroup) VALUES (4, User_lastname4, 7)

Maybe (provided a user is not a member of more than six workgroups)
select user_id,
       user_lastname,
       max(decode(rno,1,workgroup,null)) || max(decode(rno,2,','||workgroup,null)) ||
                                            max(decode(rno,3,','||workgroup,null)) ||
                                            max(decode(rno,4,','||workgroup,null)) ||
                                            max(decode(rno,5,','||workgroup,null)) ||
                                            max(decode(rno,6,','||workgroup,null)) string
  from (select user_id,
               user_lastname,
               workgroup,
               row_number() over (partition by user_id,user_lastname order by workgroup) rno
          from users
group by user_id,
          user_lastname
order by user_id,
          user_lastnameor (provided a user is not a member of more than five workgroups)
select user_id,
       user_lastname,
       string
  from (select user_id,
               user_lastname,
               row_number() over (partition by user_id,user_lastname order by workgroup) rno,
               workgroup || lead(','||workgroup,1) over (partition by user_id,user_lastname order by workgroup) ||
                            lead(','||workgroup,2) over (partition by user_id,user_lastname order by workgroup) ||
                            lead(','||workgroup,3) over (partition by user_id,user_lastname order by workgroup) ||
                            lead(','||workgroup,4) over (partition by user_id,user_lastname order by workgroup) string
          from users
where rno = 1
order by user_id,
          user_lastnameRegards
Etbin

Similar Messages

  • Can one build a data warehouse using SQL rather than Warehouse Builder?

    I would like to build a data warehouse purely using SQL statements. Where can I find the data warehouse extension of SQL statements?

    I am exploring the internal workings of Warehouse Builder.
    I have written a SQL script to generate sample data to be inserted into tables, then write SQL script to do Extraction, Transformation and Loading using MERGE,, GROUP BY CUBE, DECODE, etc.
    If anyone has any experience of just using SQL to perform ETL, would you share your expeience here? Thanks.

  • [svn:fx-3.x] 9493: Applying patch (SDK-22435) submitted by Aaron Boushley which updates ObjectUtil to use toXMLString rather than toString for XML objects .

    Revision: 9493
    Author:   [email protected]
    Date:     2009-08-23 16:09:56 -0700 (Sun, 23 Aug 2009)
    Log Message:
    Applying patch (SDK-22435) submitted by Aaron Boushley which updates ObjectUtil to use toXMLString rather than toString for XML objects.
    QE notes:  None
    Doc notes: None
    Bugs: SDK-13919
    Reviewer: N/A
    Tests run: Checkin
    Is noteworthy for integration: No
    Ticket Links:
        http://bugs.adobe.com/jira/browse/SDK-22435
        http://bugs.adobe.com/jira/browse/SDK-13919
    Modified Paths:
        flex/sdk/branches/3.x/frameworks/projects/framework/src/mx/utils/ObjectUtil.as

  • Why won't Compressor let me submit? And why use compressor rather than FCP?

    Hey I'm using Compressor with Final Cut Hd and a Powermac g5.
    So from Final Cut I've gone to 'Export' using 'Using Compressor', for a piece of Quicktime that I want to convert to Mpeg 4. IN compressor, I've set a MPEG 4 conversion, and I've set a destination. But the 'submit' button hasn't come on, and I can't go ahead with the operation. Can anyone tell me the basic things that would prevent me going ahead with the conversion here - no matter how obvious? I'm a new user, and I don't know what I'm doing wrong... any hints?
    Secondly, why do I need to use compressor for this - what's the advantage of using Compressor rather than using the QTconversion panel export from Final Cut Pro?
    Thanks for your help with these issues - you guys rock!
    Best
    Richard

    You may not have enough free hard drive spacein your destination folder or your destination folder is Write protected. I've had that problem and compressor will not always tell you why its not giving you the ok to submit yu kind of have to figure it out. *** far as the benifit of useing it the only rel one is that you can continue to use final cut to do other work while compressor is working, ut that only works if you first export it as a fcp Quick time move and then open compressor and drag and drop the fcp full dv or hdv quick time movie into compressor for compression. affter that you can quite compressor without even saving it and it will continue to work in the background only using what ever cpu power you aren't using allowing you to continue to work on other parts or projects.

  • [svn:fx-trunk] 5061: Changed the skin to use hostComponent rather than fxComponent so that binding happens on a strongly typed instance .

    Revision: 5061
    Author: [email protected]
    Date: 2009-02-24 14:18:51 -0800 (Tue, 24 Feb 2009)
    Log Message:
    Changed the skin to use hostComponent rather than fxComponent so that binding happens on a strongly typed instance. By doing this we save the overhead of calling describeType() and doing RTTI. Also updated the backgroundColor to be cast to uint until the getter/setter is updated to return that (currently it is object)
    QE: No
    Doc: No
    Checkintests: Pass
    Reviewer: Ryan F & Glenn
    Modified Paths:
    flex/sdk/trunk/frameworks/projects/flex4/src/mx/skins/spark/FxApplicationSkin.mxml

    Revision: 5061
    Author: [email protected]
    Date: 2009-02-24 14:18:51 -0800 (Tue, 24 Feb 2009)
    Log Message:
    Changed the skin to use hostComponent rather than fxComponent so that binding happens on a strongly typed instance. By doing this we save the overhead of calling describeType() and doing RTTI. Also updated the backgroundColor to be cast to uint until the getter/setter is updated to return that (currently it is object)
    QE: No
    Doc: No
    Checkintests: Pass
    Reviewer: Ryan F & Glenn
    Modified Paths:
    flex/sdk/trunk/frameworks/projects/flex4/src/mx/skins/spark/FxApplicationSkin.mxml

  • [svn:osmf:] 14927: Refactor sample to use MediaPlayer rather than traits.

    Revision: 14927
    Revision: 14927
    Author:   [email protected]
    Date:     2010-03-22 17:12:29 -0700 (Mon, 22 Mar 2010)
    Log Message:
    Refactor sample to use MediaPlayer rather than traits.  Fix typo in another example.
    Modified Paths:
        osmf/trunk/apps/samples/framework/DynamicStreamingSample/src/DynamicStreamingSample.mxml
        osmf/trunk/apps/samples/framework/ExamplePlayer/org/osmf/examples/traceproxy/TraceListene rProxyElement.as

  • Why use JPDK rather than Pl/SQL PDK

    Hi All,
    currently I have deployed all my portlets using the Pl/SQL PDK which is very good, but slow to create portlets in that it takes time to create each portlet.
    what are the advans / disadvans to using the Java PDK to create portlets ?
    I perfer to wqork at the PDK level rather than the portal application level as I have found the PDK portlets much more portable / scalable when installoing on different servers.
    Any information on the JPDK would be very helpful.
    thanks Darragh

    Hello,
    Thanks for your answer, it's very helpful. I'm still looking for a strategy to link the VO and the EO though. I thought about registering the EO in the VO as normally, but not use it in the query (obviously) then override the ViewRow and do some funky stuff in the various 'set' methods to do something like:
    setAttributeInternal(index, value);
    // somehow push the value in the EOHowever, programatically pushing the value in the EO from the VO seems trivial so far, but I'm not sure how good the result will be. I'll test it to see how well it works, but if there's any documentation about that subject that you know of, it would be appreciated.
    Thanks,
    ~ Simon

  • Using sql*plus to login to oracle 9i

    I have installed Oracle 9i for windows and am trying to login using SQL*PLUS
    user: system
    pwd: manager
    Host String: BHURU
    It says TNS could resolve service name.
    I have all the services running in the admin monitor.
    Am I missing something?

    This is not a right forum to post your problem. This is SQL PL/SQL forum.
    Please post it in Database General Forum.
    Regards.
    Satyaki De.

  • Log In using Query Rather Than a Table

    I am using CS5.
    I would to login but get the username and password from a query rather than a table.
    I am using ASP Vbscript.  The server behavior onlyl shows the tables, not the tables and queries.
    I can change the SQL and it works but there must a better way,.
    Thanks

    I don't think there is a better way. Defining a recordset based on a query is fine, but it's not something that DW handles natively.

  • Can I use thumbnails rather than the {sitename} to load different galleries?

    Hi all-
    I'm new to Spry and all things Javascripting but I'm attempting to construct a image gallery using Spry in Dreamweaver CS3. I've used the "Original Photo Gallery" from the Spry Demo folder as a jumping off point and everything works correctly.
    I would like to know if it is possible to use representative thumbnails rather than the select dropdown to launch the different galleries? I'm sure it is, but I'm a total neophyte and have no idea what to do. I'd like to set up a AP Div with 9 thumbnails in a table that would each launch a different gallery. How do I do that?
    Jimmy

    Hello, because you're SELECTing tournament.tourtype in the SELECT list, the answer is not really. If you didn't need t.tourtype in the SELECT list, you could have:
    select m.memberid, m.lastname, m.firstname
    from member m
    where exists (select 1
            from entry e inner join tournament t on (e.tourid=t.tourid)
            where m.memberid=e.memberid
                and upper(t.tourtype)='OPEN');And you know the t.tourtype is 'OPEN' anyway, so you don't need to SELECT it. So you could have this, and the answer is yes:
    select m.memberid, m.lastname, m.firstname, 'OPEN' tourtype
    from member m
    where exists (select 1
            from entry e inner join tournament t on (e.tourid=t.tourid)
            where m.memberid=e.memberid
                and upper(t.tourtype)='OPEN');Edited by: SeánMacGC on May 7, 2009 2:09 AM

  • Why should i use JSF rather than Struts?

    What makes JSF useful than Struts? In my project I am using like
    <h:commandButton action="#{loginbean.execute}" actionListener="#{loginbean.handleEvent}" ..../>
    In the above commandButton as you can see that i am not exposing the beanName. However i am exposing the beanMethod which are execute and handleEvent. Is there any other way to hide the name of the method because
    From what i understand is Presentation Layer should be shielded from whatever is going on in the backend. So, this doesn't do good right?
    Please suggest.
    How does Component and Renderers help. I am using encodeEnd() method in Renderer to render what the input or the output should look like. Do we need to switch to JSF from Struts just because of this... I don't see how and why components and renderers could help me..

    srikanthradix wrote:
    What makes JSF useful than Struts? In my project I am using like
    <h:commandButton action="#{loginbean.execute}" actionListener="#{loginbean.handleEvent}" ..../>
    In the above commandButton as you can see that i am not exposing the beanName. However i am exposing the beanMethod which are execute and handleEvent. Is there any other way to hide the name of the method because
    From what i understand is Presentation Layer should be shielded from whatever is going on in the backend.You can use "binding" and define everything in Java code if you want. You can rename your method to reflect what you want to see in the front end if you want. You can use JSFTemplating to use handlers which can be mapped to any name you want to see and do not have to match the method name of the java class (although I suspect this is the opposite direction from what you are suggesting you want).
    EL in jsf (i.e. #{bean.login}) is meant to do the mapping in JSF pages rather than externalize this in a separate file and force the page developer to edit multiple files for simple tasks. Although in some cases navigation is broken out into a separate file (i.e. faces-config.xml file using the default NavigationHandler navigation rules), this can also be done inline. It's a different way of doing development and has its pros and cons (easier, but mixes up presentation and controller somewhat). That said... JSF is very flexible, it CAN externalize any of this information, it just requires you to provide a different ViewHandler information that allows you to enter the data the way you like to see it (imo, you won't realize any benefit from the separation, though -- I used to think it was worth doing but have changed my opinion).
    So, this doesn't do good right?Perhaps in theory... but in practice, I don't think it really has a drawback. One caveat, I like how I implemented event handling in JSFTemplating as opposed to action/actionListener attributes which are not configurable and are more opaque than I prefer. My parameterized handlers allow for better code-reuse, but arguably mix up presentation and controller code even more (depending on how they're used).
    Please suggest.
    How does Component and Renderers help. I am using encodeEnd() method in Renderer to render what the input or the output should look like. Do we need to switch to JSF from Struts just because of this... I don't see how and why components and renderers could help me..The idea of a component helps tremendously as someone else can create a component for you and you can benefit from it. There are many great component sets available on the market (for free and for purchase). For example: Woodstock (which has drag/drop support inside NetBeans), RichFaces, IceFaces, Tomahawk, Scales, etc.
    Renderers allow you to cleanly separate the presentation of a component with the data of the component. You can then switch out the presentation to support multiple markups (i.e. client devices). In addition, JSF's rich lifecycle provide logical places for certain types of operations to occur, the renderers participate in this so that they are performing their tasks at a well defined time. And finally, many different components may re-use the same renderer, or a single component may use one of several renderers. The separation of data and display (model and view) makes this very clean.
    JSF is not Struts. If you expect it to be struts, you may be disappointed (or if you expect struts to be JSF, you'll be disappointed). JSF has a lot to offer (as does struts), you have to decide what is important to you and your organization. Some things to consider wrt to JSF: very strong vendor support; many large set of components to choose from; multiple standards-based tools to choose from; very flexible (most parts of the framework are pluggable); active growing development community; component-based model which encapsulates complexity for things like Ajax, pagination, and other things (often complicated in a non-component architecture); good integration with other frameworks.
    I don't know if this makes your decision any easier, but hopefully it helps clarify how you should be viewing JSF & Struts.
    Good luck!
    Ken Paulsen
    https://jsftemplating.dev.java.net

  • How can I get iTunes to use voucher rather than credit card when downloading to iPod touch?

    How can I set up an iPod touch so that it uses iTunes vouchers when downloading apps etc rather than charging to a credit card?

    Hello, Helen. 
    Thank you for visiting Apple Support Communities. 
    Here is the best resource on how iTunes Store purchase are billed. 
    iTunes Store: How iTunes Store purchases are billed
    http://support.apple.com/kb/HT5582
    Regards,
    Jason H. 

  • I want Firefox to open a new session each time I use it rather than to try to recover my previous one; how do I go about this?

    What more details do you need? I want to open a new session when I use your product rather than have the product go through the slow tedious process of trying to recreate the previous session.

    Please see this support article on [[Session Restore]]. Follow the instructions under the "Configuring session restore" header. When you get to the step where it says "Show my windows and tabs from last time" you can choose from showing your homepage or showing a blank page instead.

  • How do I post iPhoto pictures to facebook using Firefox rather than Safari?

    When I want to post iPhoto pictures to facebook, and I click on the facebook icon in the lower right corner of the iPhoto page, my facebook page comes up in Safari, when I want it to come up using Firefox.  What do I need to do to make the facebook page come up in Firefox rather than Safari?  Any help would be appreciated.  Thanks.

    Make Firfox your Default Web Browser.

  • Why I use bing rather than google?

    What are the benefits of searching information in bing rather than google?

    read this:
    http://tech-beta.slashdot.org/story/11/08/14/0419213/bing-more-effective-than-google

Maybe you are looking for

  • IPod won't stay mounted to computer, can't load any content

    I've reset it, tried to repair it with disk utility, and it still won't stay mounted. Can't put any content on it. iPod classic 160 GB Mid-2010 MacBook Pro running 10.8.5 iTunes 11.1

  • Business Objects in general

    hi can some one brief me about business objects ?Im very new to this and what basic knowledge we need to have? what exactly is bob and hw to get them in to bi? Regards, Smitha

  • Mapping a NUMBER(30) to a long?

    Seems to me it doesn't make sense to map a NUMBER(30) to a java long type, but that's what it just did. Shouldn't you map that to a BigInteger?

  • How do I transfer backup data from Bold 9780 to Q5

    I just got a Q5 and tried to restore backup from Bold 9780 usink Link but it said the software was not compatable. Any other options axailable?

  • Add dynamic fields to excel sheet

    i need to o/p the data onto a excel sheet.But some of the fields are added at runtime.ie some of the fields cannot be known until runtime,For ex. for every bill_no there may exist one or more materials which r known at runtime and these if exist has