Help: How to create a query like this?

I am working on a report and I am facing on a question like this:
TABLE TEST has two columns A and B
A B
2 INFO21
2 INFO22
3 INFO31
3 INFO32
3 INFO33
I'd like to create a query which will return
A INFO
2 INFO21, INFO22
3 INFO31, INFO32, INFO33
Please help.
Thank you in advance
Jimmy

A lot of pretty fine examples here:
http://www.oracle-base.com/articles/10g/StringAggregationTechniques.php
Rgds.

Similar Messages

  • Help: How to create a query that transpose the column content?

    Here, suppose that I have two tables
    TAB_A:
    ID     TYPE
    1     AA
    1     AB
    1     AC
    2     BA
    2     BB
    2     BC
    2     BD
    I'd like to create a query that gives result as:
    ID     TYPE
    1     AA AB AC
    2     BA BB BC BD Any suggestions?
    Thank you in advance.
    Jimmy

    Hi
    Try this:
    SELECT id,
    replace(LTRIM(MAX(SYS_CONNECT_BY_PATH(type,'*'))
    KEEP (DENSE_RANK LAST ORDER BY curr),'*'),'*', ', ') AS type
    FROM (SELECT id, type,
    ROW_NUMBER() OVER (PARTITION BY id ORDER BY type) AS curr,
    ROW_NUMBER() OVER (PARTITION BY id ORDER BY type) -1 AS prev
    FROM tab_a)
    GROUP BY id
    CONNECT BY prev = PRIOR curr AND id = PRIOR id
    START WITH curr = 1;
    Ott Karesz
    http://www.trendo-kft.hu

  • How to create a report like this.

    Userid       logintime                                                    logouttime
    367     2008-12-22 08:58:09.000          2008-12-22 10:18:02.000     
    369     2008-12-22 08:52:04.000          2008-12-22 10:18:13.000     
    371     2008-12-22 08:58:27.000          2008-12-22 10:36:24.000     
    374     2008-12-22 08:01:26.000          2008-12-22 10:17:54.000     
    375     2008-12-22 08:56:14.000          2008-12-22 10:18:16.000     
    376     2008-12-22 08:57:38.000          2008-12-22 10:17:57.000     
    463     2008-12-22 12:05:13.000          2008-12-22 13:01:39.000     
    450     2008-12-22 12:01:31.000          2008-12-22 12:14:42.000     
    from this data....i want to find how many people online each hour.
    Time      Login
    8AM         0
    9AM     5
    10AM     5
    11AM     0
    12PM     2
    01PM     0
    02PM     0
    03PM     0
    04PM     0
    05PM     0

    I don't think..both person's solution will work in this case.
    My user table data is like this.
    Userid          logintime                                  logouttime
    367              2008-12-22 08:58:09.000           2008-12-22 10:18:02.000
    369              2008-12-22 08:52:04.000           2008-12-22 10:18:13.000
    371              2008-12-22 08:58:27.000           2008-12-22 10:36:24.000
    374              2008-12-22 08:01:26.000           2008-12-22 10:17:54.000
    375              2008-12-22 08:56:14.000           2008-12-22 10:18:16.000
    376              2008-12-22 08:57:38.000           2008-12-22 10:17:57.000
    463              2008-12-22 12:05:13.000           2008-12-22 13:01:39.000
    450              2008-12-22 12:01:31.000           2008-12-22 12:14:42.000
    from this data....i want to find how many people online each hour using a report.
    Time              Login
    8AM              0
    9AM              5
    10AM            5
    11AM            0
    12PM            2
    01PM            0
    02PM            0
    03PM            0
    04PM            0
    05PM            0
    i think this is not possible using report.
    maybe i need to create a view in db from above table first and out of view should be report data...then just use report to display.
    is there a better and easy solution than above?
    nobody ever tried a report like this?.
    we need group by time function in crstal...each hour, each 30 mins, each 15 mins etc...more time features..

  • How to create text file like this?

    I want to create text file like attached file. I thought to create 2 text file: First text file make the headers ( Position, value 0,value 1....) , Second file make the table of data. Then combine them to be third text file. Someone can post other solutions?
    Attachments:
    testdf.txt ‏1 KB
    try_textfile.vi ‏18 KB

    Hi ha noi,
    you don't need 2 intermediate textfiles!
    Just write the header line first, then attach lines containing values...
    Best regards,
    GerdW
    CLAD, using 2009SP1 + LV2011SP1 + LV2014SP1 on WinXP+Win7+cRIO
    Kudos are welcome

  • How Can I write Query like this

    My Dears:
    I want to reduce some formula in my report by merge these formula in my query
    I want to know how can I wrirte a query in query
    for example
    select empno,ename,(select sal from emp ee where ee.empno=mm.empno ) from emp mm
    the previous query I know it not logic but I need the way
    my DB 10G r2
    thanks in advance

    Apart your remark nothing seems to be wrong with your query. Did you try it?
    Regards
    Etbin

  • How to create page slide like this?

    Promus - Album Release One Page Muse Template Preview - ThemeForest

    Hi,
    Please take a look at this forum post for a similar discussion : Scrolling to anchors like apple.com
    Regards,
    Aish

  • How can i create a website like this?

    Hello Adobe Community
    I've had this idea in my head for a while, but i cannot think of how to create it.
    I think of creating a website with a very nice layout where you can purchase and submit your own ebooks to sell, and they need to be approved by an admin before it shows up on the website.
    I have been thinking about this for some time but i don't have a clue on how to create a website like this and it must take a very long time.http://puu.sh/5Ki7Q.png
    My idea: You can hover over the ebooks to get more information about them, you can see star rating and feedbacks / comments under the ebooks.
    I need help with getting started on the right track, i don't know very much about Dreamweaver, but i am starting to get good at it. I know HTML and a little CSS.
    I would really appreciate any help i can get.

    Unless you have very strong coding skills with PHP & MySql,  I think you could do most of this with  WordPress and  WordPress plugins for e-commerce, star ratings, lightbox viewer, reviews, etc...
    Nancy O.

  • Can we create a table like this

    Hi experts plz help me in this
    how to create a table like this
    Class     Number   count     Amount
    First          A     1     50
              2     70
              3     60
    Second        B     1     50
              2     200
              3     9
    Thanks
    sush

    Hi
    You can create a table like this, you can use the table column property to merge the first two column for common value.
    'Grouping value' property to first column; assign the context attribute.
    Even you can do it for second column
    output will be
    First  A  1  50
             C  2  30
    Sec   B  1  20
             C  2  40

  • How do I create an image like this?

    Completely new to PS. How would I create an image like this with text? https://www.facebook.com/photo.php?fbid=10151570901245020&set=pb.50687255019.-2207520000.1 366989903.&type=3&theater
    A link to a tutorial would be helpful.
    Thanks!

    Hi there,
    Are you referring to the text, the color effect, or both?
    Adding type is very easy - just grab the Type Tool from the tool bar. The article linked above provides some great tips for editing type in Photoshop.
    As is the case with many "how to's" for Photoshop, there are several ways to acheive the colorized effect like the one applied to image you linked to. One method is to use Adjustment Layers, which I have outlined below.
    1. With your image layer active (it will be highlighted in blue in your Layers panel, as shown below), create a selection of the area you'd like to colorize. I'm using the Polygonal Lasso Tool to create a diagonal selection - to do so, I held down the Shift key on my keyboard as a created my diagonal lines. This might take a bit of practice, but you'll get the hang of it quickly.
    2. Then, in your Adjustments panel (if you don't see it, go to Window > Adjustments), click on the Curves adjustment layer, as highlighted below. Now you can play around with the curves to get the effect you'd like. (Here's a quick guide on using the Curve tool)
    3. To select the other areas of your image, command (Mac) / control (PC) click on the adjustment layer thumbnail (highlighted below). Then, go to Select > Inverse.
    4. Now we want to deselect part of our selection. Grab the Quick Selection Tool from the toolbar and set it to Subract from selection. Then, simply drag the selection brush over the area you want to deselect. In my case, I only want to have the upper-left corner of my image selected.
    5. After you have your selection, click on the image layer and add a Curves adjustment layer like before.
    6. Repeat steps 3-5 for the other corner of your image and you should end up with something like this:
    The nice thing about using adjustment layers is that you can always change them - just double click on the Adjustment layer thumbnail (highlighted in step 3).
    Alternatively, you can select areas of your image and fill the selections with flat colors on separate layers. You can then go in a change the Blend Mode and Opacity for each layer.
    Feel free to reply with any questions!
    Kendall

  • How to create sql query for item master with operator LIKE with variables?

    hi all,
    How to create sql query for item master with
    operator LIKE(Contains,Start With,End With) with variables using query generator in SAP B1 ?
    Jeyakanthan

    Hi Jeyakanthan,
    here is an example (put the like statement into the where field)
    SELECT T0.CardCode, T0.CardName FROM OITM T0 WHERE T0.CardName Like '%%test%%'
    The %% sign is a wildcard. If you need start with write 'test%%' and otherwise ends with '%%test'. For contains you need '%%test%%'. You also could combinate this statements like 'test%%abc%%'. This means starts with test and contains abc.
    Regards Steffen

  • I used to make booklets on Publisher that would be printed on 11X17 folded and stapled down middle.  Can someone please tell me best program to create a document like this in on a mac and how to print it on 11X17?

    I used to make booklets on Publisher that would be printed on 11X17 then be folded and stapled down middle.  Can someone please tell me best program to create a document like this in on a mac and how to print it on 11X17?

    Try iStudio Publisher

  • Help need to create a query

    I need to fetch records from a table. Please help me to create a query
    The Tablename is Employee. It has the following records
    Department Empname Gender
    Finance Tom Male
    Finance Rick Male
    Finance Stacy Female
    Corporate Tom Male
    Corporate Rob Male
    I want to select the value of the Gender field from the Employee table corresponding to a Department
    If all the values in the Gender field are 'MALE' corresponding to 'finance' in the Department field, the value should be 'MALE'
    If there is a value 'FEMALE', the gender corresponding to the Empname 'TOM' should be considered as the gender

    Tables have rows - not records.
    Your question is a basic SQL language question - which means you do not know the SQL language. This forum is not a classroom for teaching you the SQL language.
    Use the following as the basic outline of how your SQL language statement need to look like for selecting the required from the table:
    SELECT
      <<sql projection goes here>>
    FROM <<table name goes here>>
    WHERE <<filter conditions go here>>
    {code}
    The SQL projection specifies the list of columns the SQL need to return to the caller.
    The filter condition is basic predicates and AND and OR  can be used for multiple predicates.
    Go to http://tahiti.oracle.com and look for the +SQL Reference Guide+ for the Oracle version you are using. The +SELECT+ statement syntax is covered in detail and sample statements are provided.
    And please do not expect this forum to be used as a classroom, or expect this forum to do your homework for a class.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           

  • How to create sap query with "or" relationship

    dear experts,
    I need a report to display the employee whoese WSR is
    changed in the month for infotype 0007.
    that is ,we want to search with selection
    begda OR endda between 2008-01-01 and 2008-01-31.
    how to create sap query with "or" relationship?

    hi use like this,
    CALL FUNCTION 'HR_READ_INFOTYPE'
      EXPORTING
        pernr                 =  p_pernr
        infty                   =  '0007'
       BEGDA                =  p_date1
       ENDDA                 = p_date2
      TABLES
        infty_tab             = itab .
    hi use this by passing the pernr to fm and giving the dates low and high in the p_date1 and p_date2.
    loop at itab where condition.
    endloop.
    may it helps u,
    regards,
    venkat.

  • How to create a query view in sap bw?

    can any one please tell me how to create a query view in sap bw 3.5?

    Hi,
    you can do this by using Bex analyzer and WAD ..
    gop through this link ..
    http://help.sap.com/saphelp_nw70/helpdata/en/0e/1339427f82b26be10000000a155106/content.htm
    http://help.sap.com/saphelp_nw70/helpdata/en/0d/af12403dbedd5fe10000000a155106/frameset.htm
    hope this helps you ..
    Reagrds,
    shikha

  • How to create report image like artwork demo

    Dear Pakars
    How to create report image like artwork demo ?
    Thanks
    Imansyah

    Hello,
    Are you asking how to include images in a report? If so, take a look at the declarative blob support documentation -
    http://www.oracle.com/technology/obe/apex/apex31nf/apex31blob.htm
    Hope this helps,
    John.
    Blog: http://jes.blogs.shellprompt.net
    Work: http://www.apex-evangelists.com
    Author of Pro Application Express: http://tinyurl.com/3gu7cd
    REWARDS: Please remember to mark helpful or correct posts on the forum, not just for my answers but for everyone!

Maybe you are looking for

  • Link to URL - How to Open a New Tab

    I have created some PDF's in Adobe Acrobat and I am hosting them on my website. So for example here is one: <possible spam link removed - kglad> I have created links to URL's using the Link Properties tool, Actions tab. However it will only open the

  • Converting a BufferedImage to an Image

    I have a program with some BufferedImages that the user needs to be able to drag around the screen. 1) The dragging process is very sluggish when I use BufferedImages, but not when I use normal Images. Is this normal, or is something wrong with my pr

  • Trouble with a int parameter

    im haveing a problem grabing a integer parameter from a html page <PARAM name="parbg" value="1"> first i get incompatible types so i changed it now i get testmenu17.java:91: getParameter(java.lang.String) in java.applet.Applet cannot be applied to (i

  • Trying To Add UIScrollbar To Flash Website But FLA File Has No Layers

    I was asked to add content to a flash website page... When I open the FLA file, there are aboslutely no layers for me to work with. I found an .as file that contained the page content and so I added the needed content there. But this is where I run i

  • InvokeLater

    I have read the documents about the EDT. So I have a simple question: Suppose you have a JFrame which contains just one JLabel. Your application has a thread that receives datagrams from the net. You want your JLabel to display the number of packets