Display Ids in one row

Hi I need to avoid extracting the Ids multiple times. That is display first Id for the receipt_no as Primary Id and display the next ocurring ones as associate Ids in one line. There could be more than one associate Ids with one receipt. Any help appreciated.
Sample Query as below:
SELECT DISTINCT gift_id,receipt, asssociate_donor_id, associate_donor
from g2
LEFT OUTER JOIN (SELECT DISTINCT gift_id asssociate_donor_id
,receipt_number
,e2.name AS associate_donor
FROM X
JOIN advance.entity e2 ON (e2.id_number = gift_donor_id)
WHERE
AND receipt_date >=
to_date('01/01/2000'
,'dd/mm/yyyy')) g4 ON (g2.gift_id !=
asssociate_donor_id AND
g2.receipt =
g4.receipt_number )
Sample table
Id     receipt_no     cash
1     101          $100
2     101          $100
3     102          100
Sample Expected Result:
1, 101, 2, Mark
3, 102
Many Thanks

You didn't really provide enough data to arrive at your expected output, so I took the liberty of creating some. If my data do not match yours, perhaps you'll provide yours and we can give you a better answer....
WITH receipts AS
           ( SELECT 1 gift_id, 101 receipt_id, 201 gift_donor_id, 100 amt FROM DUAL
   UNION ALL SELECT 2, 101, 202, 100 FROM DUAL
   UNION ALL SELECT 3, 102, 203, 100 FROM DUAL )
  , donors AS ( SELECT 201 AS donor_id, 'Matthew' donor_name FROM DUAL
      UNION ALL SELECT 202, 'Mark' FROM DUAL
      UNION ALL SELECT 203, 'Luke' FROM DUAL)
, g2 AS ( SELECT receipts.*, row_number() OVER ( PARTITION BY receipt_id ORDER BY gift_id ) gift_ordering
          FROM receipts )
, donations as ( SELECT gift_id, receipt_id
                 FROM g2
                 WHERE gift_ordering = 1 )
, assocs AS ( SELECT receipt_id , donor_name , COUNT(*) assoc_cnt
                 FROM g2 JOIN donors ON ( gift_donor_id = donor_id )
                 WHERE gift_ordering > 1
                 GROUP BY receipt_id , donor_name)
SELECT donations.gift_id
     , donations.receipt_id
     , assocs.assoc_cnt + 1 total_donors_on_receipt
     /* will be NULL if only one donor */
     , assocs.donor_name
FROM donations
  LEFT JOIN assocs ON ( donations.receipt_id  = assocs.receipt_id )And the output...
   GIFT_ID RECEIPT_ID TOTAL_DONORS_ON_RECEIPT DONOR_N
         1        101                       2 Mark
         3        102
2 rows selected.I hope this helps, or at least points you in the right direction.

Similar Messages

  • Display results in one row

    Query below is returning data in multiple rows, I want to display them as one row:
    select
    event_id,
    data_type_cd,
    quantity
    from Event,Data_types
    where event_id = 1234
    and event.DATA_TYPE_ID = data_types.DATA_TYPE_ID
    (I want to display data_type_cd concatenated with quantity as every code had different quantity)

      > Sample data is:
      > Data_type_id Quantity
      > ------------------ ----------
      > 1 34
      > 2 67
      > 15 35
      > 20 23
      > I want to display as:
      > 1 34 2 67 15 35 20 23
    if you want all the rows in one column see this given example below:
      SQL> select t.*
        2    from (select  1 data_type_id, 34 quantity from dual union all
        3          select  2 data_type_id, 67 quantity from dual union all
        4          select 15 data_type_id, 35 quantity from dual union all
        5          select 20 data_type_id, 23 quantity from dual) t;
      DATA_TYPE_ID   QUANTITY
                 1         34
                 2         67
                15         35
                20         23
      SQL> select substr(sys_xmlagg(xmlelement(col, ' ' || data_type_id||' '||quantity)).extract('/ROWSET/COL/text()').getclobval(), 2) new_disp
        2    from (select  1 data_type_id, 34 quantity from dual union all
        3          select  2 data_type_id, 67 quantity from dual union all
        4          select 15 data_type_id, 35 quantity from dual union all
        5          select 20 data_type_id, 23 quantity from dual) t;
      NEW_DISP
      1 34 2 67 15 35 20 23
      SQL>

  • Displaying records in one row??

    The Board table has the following columns Userrecordid,Board_codes and the data is being displayed as:
    Here is the data in the Boards Table:
    Userrecordid     Board_codes     Board_Number
    m001     KBIM     A1234
    m001     PBIM     B1234
    m002     PBIM     Dytu1
    m003     PBIM     io34I had written a query(splitting KBIM code data & PBIM code data which actually brought back results as seen below:
    KBIM (Y/N)     KBIM #     PBIM (Y/N)     PBIM #
    Y     A1234     NULL     NULL
    NULL     NULL     Y     B1234I need to display the above results in one row shown as below:
    KBIM (Y/N)     KBIM #     PBIM (Y/N)     PBIM #
    Y     A1234     Y     B1234

    Hi,
    francislazaro wrote:
    The Board table has the following columns Userrecordid,Board_codes and the data is being displayed as:
    Here is the data in the Boards Table:
    Userrecordid     Board_codes     Board_Number
    m001     KBIM     A1234
    m001     PBIM     B1234
    m002     PBIM     Dytu1
    m003     PBIM     io34...
    I need to display the above results in one row shown as below:
    KBIM (Y/N)     KBIM #     PBIM (Y/N)     PBIM #
    Y     A1234     Y     B1234
    So you don't want anything in the results about userrecordids 'm002' and 'm003', because they do not have both board_codes 'KBIM' and 'PBIM', is that it?
    One way to get those results is a self-join, as if all the rows with borad_code 'KBIM' were in one table, and all the rows with borad_code 'PBIM' were in another:
    SELECT     'Y'          AS "KBIM (Y/N)"
    ,     k.boradnumber     AS "KBIM #"
    ,     'Y'          AS "PBIM (Y/N)"
    ,     k.boradnumber     AS "KBIM #"
    FROM     boards     k
    JOIN     boards     p     ON     k.userrecordid     = p.usrrecordid
    WHERE     k.board_codes     = 'KBIM'
    AND     p.board_codes     = 'PBIM'
    ;Another way is a GROUP BY, like Mpautom suggested.
    If your requirements change in the future, so that you need to include all rows, even if they don't have both board_codes, then you could change the JOIN to a FULL OUTER JOIN and make what I wrote as the WHERE clause part of the join condition, but I suspect the GROUP BY approach would be more efficient in that case.

  • How can I DISPLAY MORE THAN ONE ROW OF PHOTOS WHEN CREATING A BOOK?

    Can I display more than A SINGLE ROW of ohotos on the right side of the page when I am creating a photo book? I have 500 pics and this single bar is ridiculous.

    Command (right) - click on a photo in the Photo tray and select Small Photo from the contextual menu:
    This will give you two columns of photos.
    To reduce the number of photos to select from one can select only Unplaced Photos to be displayed in the tray.
    Happy Holidays

  • Displaying data in one row for  for 2 tables without relaiton

    I Have 2 tables without any relation and there is a common field and i want to display data like below
    table refdet
    1)
    refdt----------refbr----refamt----refcat
    10-aug-09---10-----34234-----101a
    10-aug-009--11----23245-----102a
    1-AUG-09----10----455.98----104A
    19-aug-09-12-----10000-------103B
    2) brdet
    trdt---------brn-----brtot-----------brcat
    11-aug09--10-----454000-------A
    09-aug-09-12-----550000-------B
    30-sep-09--10-----430000------A
    09-aug-09-11-----550000-------B
    i want to display data for each branch refdet.refbr = brdet.brn
    refdet
    Br10
    refdt----------refbr----refamt----refcat-----trdt---------brn-----brtot-----------brcat
    10-aug-09---10-----34234-----101a-------11-aug09--10-----454000-------A
    1-AUG-09----10----455.98----104A------30-sep-09--10-----430000------A
    Br 11
    10-aug-009--11----23245-----102a -------09-aug-09-11-----550000-------B
    Br12
    19-aug-09-12-----10000-------103B------09-aug-09----12-----550000-------B
    i tried the following query but its not working
    select distinct null as refdt,null as refbr,null as refamt,null as refcat,b.trdt,b.brn,b.brtot,b.brcat
    from brdet a,refdet b
    where a.refbr (+) = b.brn
    union all
    select distinct a.refdt,a.refbr,a.refamt,a.refcat,null as trdt,null as brn,null as brtot,null as brcat
    from brdet a,refdet b
    where a.refbr = b.brn (+)
    its not giving the records on each row for both side its creating separte rows for each records in both table.
    rgds
    jytohi
    -

    Hi jytohi,
    Please lean back for a moment and study your question. Ask yourself, is this a reasonable way to ask a question?
    Jopefully you'll reach the answer, "No it isn't, I need to.."
    1. Turn these
    1)
    refdt----------refbr----refamt----refcat
    2) brdet
    trdt---------brn-----brtot-----------brcatinto CREATE TABLE statements.
    2. Turn these
    10-aug-09---10-----34234-----101a
    10-aug-009--11----23245-----102a
    1-AUG-09----10----455.98----104A
    19-aug-09-12-----10000-------103B
    11-aug09--10-----454000-------A
    09-aug-09-12-----550000-------B
    30-sep-09--10-----430000------A
    09-aug-09-11-----550000-------Binto INSERT INTO statements
    3. Turn this
    refdet
    Br10
    refdt----------refbr----refamt----refcat-----trdt---------brn-----brtot-----------brcat
    10-aug-09---10-----34234-----101a-------11-aug09--10-----454000-------A
    1-AUG-09----10----455.98----104A------30-sep-09--10-----430000------A
    Br 11
    10-aug-009--11----23245-----102a -------09-aug-09-11-----550000-------B
    Br12
    19-aug-09-12-----10000-------103B------09-aug-09----12-----550000-------Binto properly formatted expected output, along with a reasonable explanation of why
    4. Turn this
    select distinct null as refdt,null as refbr,null as refamt,null as refcat,b.trdt,b.brn,b.brtot,b.brcat
    from brdet a,refdet b
    where a.refbr (+) = b.brn
    union all
    select distinct a.refdt,a.refbr,a.refamt,a.refcat,null as trdt,null as brn,null as brtot,null as brcat
    from brdet a,refdet b
    where a.refbr = b.brn (+)into a properly formatted query
    And last, put everything in into curly brackets {noformat}{noformat} to preserve formatting and blank space.
    Best regards
    Peter                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               

  • Displaying more than one column in TreeControl

    Hi,
    I have three tables ( LaborOperation, LaborIndex, LaborData). In TreeControl, i am displaying the following table columns,
    LaborOperation ->operationid,
    LaborIndex -> indexid,
    LaborData -> date, value.
    i want to be like this.
    + Operation Id(Single Column)
    + OperationIndex(Single Column)
    -OperationData(Multiple Column)
    I can able to display single column values in tree control by setting the nodedifinition property in tree control. i can't able to display more than one column in tree control.
    any idea about this problem
    thanks in advance.
    -Nainar

    Arun Prasath wrote:
    I want to display more than one row in a multiple columns of a single row.
    For example,
    In oracle apps, there are multiple tax lines for a single invoice. Each tax lines having their own entry in tax detail table.
    When i try to display a single invoice's details in a single row i found the difficulty.Hmm did you see the title of the forum? Oracle Database » General Questions !
    May be you want to check the Oracle Apps forum?
    Aman....

  • Display array data in one row

    Hello ---
    I have an array of data, I would like to be displayed all the data in one row.<tr></tr>, how to do this?
    If I use <h:table> <column></column></h:table>, it will display different rows.
    Thanks!
    Ben

    Populate the components in the backingbean. Try something like:
    JSF<h:panelGrid binding="#{myBean.grid}" />MyBeanprivate List arrayOfData;
    private HtmlPanelGrid grid; // + getter + setter
    private void populateGrid() {
        grid = new HtmlPanelGrid();
        grid.setColumns(arrayOfData.size());
        for (Iterator iter = arrayOfData.iterator(); iter.hasNext();) {
            Object value = iter.next();
            HtmlOutputText text  = new HtmlOutputText();
            text.setValue(value);
            grid.getChildren.add(text);
    }

  • Return more than one row to display as text?

    I don't know if this is possible or not. I'd rather not create a report for one item.
    is there a way to allow a display as text filed show more than one item from a query? I've tryed several things none work. I have one field that I'd like to show multiple data as just text. but everything I try displays one row only in the field. is there a way around this?

    Nazdev,
    If you're trying to display multiple records as separate parts (not just concatenated together), the easiest solution would be a report. If you just want to append values together and present them in a single item, you should be able to create a query to build your string pretty easily, though you might need to write an Oracle function to do the concatenation for you.
    I wrote a function to do that a while back, obvious you should check it thoroughly before you use it.
    CREATE OR REPLACE FUNCTION cursor_to_list(cur_in IN aeo_misc_tools.string_ref_cur,
                                              delimiter_in IN VARCHAR2 := ', ',
                                              max_len_in IN PLS_INTEGER := 32000,
                                              more_string_in IN VARCHAR2 := 'More...') RETURN VARCHAR2 IS
            Description:    Given single-column ref cursor, return values separated
                            by delimiter parameter value.
                            Trim last trailing delimiter.
            Parameters:     cur_in - opened cursor w/ single string column
                            delimiter_in - separate values w/ this, defaults to comma-space
                            max_len_in - maximum returned length
                            more_string_in - Append if length would be longer than max_len_in
            Returns:        String of separated values
            Author:         Stew Stryker
            Usage:          children_list := cursor_to_list(cur_in => child_cur, delimiter_in => ' | ');
            Note: Can also pass a cursor to this directly, using the CURSOR clause, as follows:
            children_list := cursor_to_list(CURSOR(SELECT pref_mail_name FROM children
                                                WHERE parent_id = '0000055555' ORDER BY dob),
                                delimiter_in => ' | ');
        TYPE single_string_rec_t IS RECORD(
            string_val VARCHAR2(256));
        TYPE string_ref_cur IS REF CURSOR;
        row_value single_string_rec_t;
        ret_list VARCHAR2(32000);
        more_string VARCHAR2(256) := NVL(more_string_in, ' ');
        delim_len CONSTANT PLS_INTEGER := LENGTH(delimiter_in);
        more_len CONSTANT PLS_INTEGER := LENGTH(more_string_in);
        max_len PLS_INTEGER := max_len_in - more_len - delim_len;
    BEGIN
        IF max_len > 0
        THEN
            IF cur_in%ISOPEN
            THEN
                FETCH cur_in
                    INTO row_value;
                WHILE cur_in%FOUND
                LOOP
                    IF NVL(LENGTH(ret_list), 0) + NVL(LENGTH(row_value.string_val), 0) + delim_len <=
                       max_len
                    THEN
                        ret_list := ret_list || row_value.string_val || delimiter_in;
                    ELSIF INSTR(NVL(ret_list, ' '), more_string) = 0
                          AND NVL(LENGTH(row_value.string_val), 0) > 0
                    THEN
                        ret_list := ret_list || more_string;
                    END IF;
                    FETCH cur_in
                        INTO row_value;
                END LOOP;
                -- Strip last delimiter
                ret_list := RTRIM(ret_list, delimiter_in);
                CLOSE cur_in;
            END IF;
        END IF;
        RETURN ret_list;
    EXCEPTION
        WHEN no_data_found THEN
            RETURN ret_list;
        WHEN OTHERS THEN
            DBMS_OUTPUT.PUT_LINE('EXCEPTION IN aeo_misc_tools.cursor_to_list - ' || TO_CHAR(SQLCODE) || ': ' ||
                                 SQLERRM);
            RAISE;
            RETURN ret_list;
    END cursor_to_list;Good luck,
    Stew

  • Number of Rows, displaying a table with only one row

    Hello,
    I am doing my first VC tests on the discovery System.
    I have an input form where I put in the username, then choose a user from a table and with the user ID I want to show the user details in another table.
    Now since I am only pickling one user, the new table will only have one row. In VC I cannot set the no. of rows to 1 though, since I cannot edit the no. of rows field. I also cannot disable the scroll buttons.
    Why is that?
    Is there another way to display user details? I tried to display it in read-only form, but it is pretty ugly.
    Another question regarding designing in VC:
    Are there any design elements in VC for example to group form fields that belong together? Let's say I have street name, number, postal code and so on, could I use a design element to group them under the label "Address" ?

    Peter,
    For some reason the No. of Rows and Scroll Buttons options are only available if your compiler is set to Web DynPro. Whenever you compile to Flash they're disabled.
    Regards
    Hennie

  • Display only one row for distinct columns and with multiple rows their valu

    Hi,
    I have a table having some similar rows for some columns and multiple different rows for some other columns
    i.e
    o_mobile_no o_doc_date o_status d_mobile_no d_doc_date d_status
    9825000111 01-jan-06 'a' 980515464 01-feb-06 c
    9825000111 01-jan-06 'a' 991543154 02-feb-06 d
    9825000111 01-jan-06 'a' 154845545 10-mar-06 a
    What i want is to display only one row for above distinct row along with multiple non distinct colums
    ie
    o_mobile_no o_doc_date o_status d_mobile_no d_doc_date d_status
    9825000111 01-jan-06 'a' 980515464 01-feb-06 c
    991543154 02-feb-06 d
    154845545 10-mar-06 a
    regards,
    Kumar

    Re: SQL Help

  • I wanted to display the multiple rows in one row but column should be diff

    Hi
    Could any body help me regarding this query how to write to get the multiple rows in one row.
    eg.
    i have one table tab1(eno number,ename varchar2,uid1 varchar2,uid2 varchar2,uid3 varchar4)
    but when i am runing the query I am getting multiple record against one eno number because of uid1,uid2,uid3
    suppose value of table is
    eno ename uid1 uid2 uid3
    1 a u1
    1 a u2
    1 a u3
    when i am quering it is coming same as above but I want in one row
    eno ename uid1 uid2 uid3
    1 a u1 u2 u3
    can any onle help me how to write the query for this requirement.
    thanks
    saif

    which is hard coded in my code? Here another approach, but fail for c as there is no information for the value of a column: does 1 in u1 means col 1, etc.
    /* Formatted on 2012/05/29 16:29 (Formatter Plus v4.8.8) */
    WITH t AS
         (SELECT 1 col1, 'a' col2, 'u1' col3
            FROM DUAL
          UNION ALL
          SELECT 1 col1, 'a' col2, 'u2' col3
            FROM DUAL
          UNION ALL
          SELECT 1 col1, 'a' col2, 'u3' col3
            FROM DUAL
          UNION ALL
          SELECT 1 col1, 'b' col2, 'u1' col3
            FROM DUAL
          UNION ALL
          SELECT 1 col1, 'b' col2, 'u3' col3
            FROM DUAL
          UNION ALL
          SELECT 1 col1, 'b' col2, 'u2' col3
            FROM DUAL
          UNION ALL
          SELECT 1 col1, 'c' col2, 'u1' col3
            FROM DUAL
          UNION ALL
          SELECT 1 col1, 'c' col2, 'u3' col3
            FROM DUAL)
    SELECT   xx.col1, xx.col2, MAX (DECODE (xx.rn, 1, col3)) AS uid1, MAX (DECODE (xx.rn, 2, col3)) AS uid2,
             MAX (DECODE (xx.rn, 3, col3)) AS uid3
        FROM (SELECT t.col1, t.col2, t.col3, ROW_NUMBER () OVER (PARTITION BY col1, col2 ORDER BY col3) rn
                FROM t) xx
    GROUP BY col1, col2;output:
    COL1     COL2     UID1     UID2     UID3
    1     a     u1     u2     u3
    1     b     u1     u2     u3
    1     c     u1     u3
    Edited by: ʃʃp on May 29, 2012 2:30 AM

  • Display one row only

    This query
    SELECT
    SCRATTR_ATTR_CODE
    from scrattr_TEST,scbcrse_TEST
    where
    SUBSTR(scbcrse_subj_code,1,3)  = SUBSTR(scrattr_subj_code,1,3)
    and SUBSTR(scbcrse_crse_numb,1,4)  = SUBSTR(scrattr_crse_numb,1,4)Returns this
    SCRATTR_ATTR_CODE
    A
    INS
    MCSR How I can make to return someting like A INS MCSR in one row there is a row for every code
    hERE is some code to create the tables and insert the data
    CREATE TABLE SCRATTR_test
      SCRATTR_SUBJ_CODE      VARCHAR2(4 CHAR)       NOT NULL,
      SCRATTR_CRSE_NUMB      VARCHAR2(5 CHAR)       NOT NULL,
      SCRATTR_EFF_TERM       VARCHAR2(6 CHAR)       NOT NULL,
      SCRATTR_ATTR_CODE      VARCHAR2(4 CHAR)
      CREATE TABLE SCBCRSE_test
      SCBCRSE_SUBJ_CODE              VARCHAR2(4 CHAR) NOT NULL,
      SCBCRSE_CRSE_NUMB              VARCHAR2(5 CHAR) NOT NULL,
      SCBCRSE_EFF_TERM               VARCHAR2(6 CHAR)
    insert into SCRATTR_test (SCRATTR_SUBJ_CODE,SCRATTR_CRSE_NUMB,SCRATTR_EFF_TERM,SCRATTR_ATTR_CODE) select 'BIO','2210','201320',' A' from dual;
    insert into SCRATTR_test (SCRATTR_SUBJ_CODE,SCRATTR_CRSE_NUMB,SCRATTR_EFF_TERM,SCRATTR_ATTR_CODE) select 'BIO','2210','201320','INS' from dual;
    insert into SCRATTR_test (SCRATTR_SUBJ_CODE,SCRATTR_CRSE_NUMB,SCRATTR_EFF_TERM,SCRATTR_ATTR_CODE) select 'BIO','2210','201320','MCSR' from dual;
    COMMIT;
    INSERT INTO  SCBCRSE_test(SCBCRSE_SUBJ_CODE,SCBCRSE_CRSE_NUMB,SCBCRSE_EFF_TERM) SELECT  'BIOL','2210','201320' FROM DUAL
    COMMIT; Thank you

    Based on your testcase, on 11.2 you could just:
    SQL> select listagg(a.SCRATTR_ATTR_CODE, ' ') within group (order by rownum)
      2  from   scrattr_TEST a
      3  ,      scbcrse_TEST b
      4  where  SUBSTR(b.scbcrse_subj_code,1,3)  = SUBSTR(a.scrattr_subj_code,1,3)
      5  and    SUBSTR(b.scbcrse_crse_numb,1,4)  = SUBSTR(a.scrattr_crse_numb,1,4);
    LISTAGG(A.SCRATTR_ATTR_CODE,'')WITHINGROUP(ORDERBYROWNUM)
    A INS MCSR

  • Columns adjustment in one row

    Hello,
    I hope some1 can help me for these.
    I am using apex 3.1.2 ver
    My first question: how can I put more columns for example 4 columns with heading in one row? when I do, screen is too wide but i do not want scrolling?
    e.g
    aaaaaaaaaaaaaaa( ) bbbbbbbbbbbbbb ( ) ccccccccccccccccc ( ) ddddddddddd( )
    second question?
    how can i display second column value based on first column value before saving the page?
    e.g. aaaaaaa(1) bbbbbbbb(should display text value based on first column)
    for example 1 - abc
    2 - def
    3 - ghi and so on.
    last question? how can i disable the column? should column enable based on other column? e.g if a then second column take value other disabled?
    Many thx.
    kind regards,

    Irha10 wrote:
    how can I put more columns for example 4 columns with heading in one row? when I do, screen is too wide but i do not want scrolling?In item property change "Begin on new Line " to "Yes"
    Irha10 wrote:
    how can i display second column value based on first column value before saving the page?01. You have to create a branch to same page
    02. Submit the page using any event (such as button press or something). So when you enter details to first item and then press button then page will submit and reload the same page.
    03. In the page create a before region process and check whether second item is not null and third item is null then populate third item. Then first item is not null and second item null then populate second item.
    Irha10 wrote:
    ? how can i disable the column? should column enable based on other column? e.g if a then second column take value other disabled?You can use a java script and enable and dissable item based on any condition such as value of another item
    Example
    if ($x('P16_YYY').value !='SOME VALUE')
      $x('P16_XXX').disabled = true;
    }else
      $x('P16_XXX').disabled = false;
    }

  • Multiple records in one row

    Hi all,
    I want to display all the party codes which have same party name,
    and I want to display all the party codes in one row separated by comma. is it possible?

    You can either use analytic functions + hierarchy or stragg (listagg if you are on 11.2) or undocumentd wm_concat. There are plenty examples on this forum. For example:
    select  deptno,
            ltrim(sys_connect_by_path(job,','),',') job_list
      from  (
             select  deptno,
                     job,
                     row_number() over(partition by deptno order by job) rn
               from  emp
      where connect_by_isleaf = 1
      start with rn = 1
      connect by deptno = prior deptno
             and rn = prior rn + 1
        DEPTNO JOB_LIST
            10 CLERK,MANAGER,PRESIDENT
            20 ANALYST,ANALYST,CLERK,CLERK,MANAGER
            30 CLERK,MANAGER,SALESMAN,SALESMAN,SALESMAN,SALESMAN
    select  deptno,
            rtrim(stragg(job || ','),',') job_list
      from  emp
      group by deptno
        DEPTNO JOB_LIST
            10 MANAGER,PRESIDENT,CLERK
            20 CLERK,ANALYST,CLERK,ANALYST,MANAGER
            30 SALESMAN,MANAGER,SALESMAN,SALESMAN,CLERK,SALESMAN
    select  deptno,
            wm_concat(job) job_list
      from  emp
      group by deptno
        DEPTNO JOB_LIST
            10 MANAGER,PRESIDENT,CLERK
            20 CLERK,ANALYST,CLERK,ANALYST,MANAGER
            30 SALESMAN,MANAGER,SALESMAN,SALESMAN,CLERK,SALESMANSY.

  • Show Column Data In One Row

    Hello,
    Tell Me how i can show a single column data in one row.
    10
    20
    30
    To
    10,20,30

    If you are OK with displaying comma separated list or column data you could:
    SQL> select  ltrim(sys_connect_by_path(ename,','),',') ename_list
      2    from  (
      3           select  ename,
      4                   row_number() over(order by 1) rn,
      5                   count(*) over() cnt
      6             from  emp
      7          )
      8    where rn = cnt
      9    start with rn = 1
    10    connect by rn = prior rn + 1
    11  /
    ENAME_LIST
    SMITH,ALLEN,WARD,JONES,MARTIN,BLAKE,MILLER,SCOTT,KING,TURNER,ADAMS,JAMES,FORD,CLARK
    SQL> To display as separate columns you would need to either know number of rows:
    SQL> select  min(case rn when 1 then ename else null end) ename1,
      2          min(case rn when 2 then ename else null end) ename2,
      3          min(case rn when 3 then ename else null end) ename3,
      4          min(case rn when 4 then ename else null end) ename4,
      5          min(case rn when 5 then ename else null end) ename5,
      6          min(case rn when 6 then ename else null end) ename6,
      7          min(case rn when 7 then ename else null end) ename7,
      8          min(case rn when 8 then ename else null end) ename8,
      9          min(case rn when 9 then ename else null end) ename9,
    10          min(case rn when 10 then ename else null end) ename10,
    11          min(case rn when 11 then ename else null end) ename11,
    12          min(case rn when 12 then ename else null end) ename12
    13    from  (
    14           select  ename,
    15                   rownum rn
    16             from  emp
    17          )
    18  /
    ENAME1  ENAME2  ENAME3  ENAME4  ENAME5  ENAME6  ENAME7  ENAME8  ENAME9  ENAME10  ENAME11  ENAME12
    SMITH   ALLEN   WARD    JONES   MARTIN  BLAKE   CLARK   SCOTT   KING    TURNER   ADAMS    JAMES
    SQL> or use dynamic SQL.
    SY.

Maybe you are looking for

  • How can we move LSMW from Development server to Production

    Hi pls give me idea on 1) how we can test lsmw 2) how we can move from  one server  to another server 3) how we can do you it to use periodically 4)What is use of radio buttons once and periodic in maintain attributes screen thanks

  • All music (eg itunes library) on an external hard drive

    hello... i was thinking...i have an imac....and three ipods...and eventually i will buy a ipod video (i now have two nanos--my kids actually--and a ipod photo60gig) ....i was considering having all of my music (itunes library) on an external HD ...so

  • I have the dreaded blue screen need HELP????!

    I was just downloading the updates and then the computer restarted and the screen is blue, mouse still works. I was looking at other articles for bluescreen but it was for an installation of Leopard problem. The program I have in my computer is 10.2.

  • HELP: FAGLF101 additional currency can't post.

    we define a "fi valuation area" z1, with  currency type 10(company code currency) and additional currency (40 hard currency) .these two currency type of company A are different. when running tcode : faglf101 for company A ; the program does't post th

  • Extracting personal settings in ME21N

    I would like to extract the default values from personal settings in ME21N. Is there a function module to do this?