Combine the rows based on the value of the column

I try to combine lines based on a common value.

Data in the table:
Result A
Player_ID   Player_Name  Team_Name  Points Sequence
99999       John Smith    Bulls              50         1
99999       John Smith    Pistons          14         2


What i want in the output
Result B

Player_ID Player_Name Team_Name  Points
99999     John Smith      Bulls           64 (50 for Bulls)
Here are my main request...
select player_id, player_name, team_name, points
from
        (
          SELECT player_id, player_name, team_name, sum(points) sum_points
          FROM stats_data
          WHERE season_id = 2008
          AND points > 0
          GROUP BY player_id, player_name, team_name
          ) t
ORDER BY sum_points DESC, last_name;
Current query gives me the result of the result of A

(1) not entirely sure how, to combine the player_id basic data
2) once I found 1, I'm sure that by adding the ("sum_points" for "team_name") to the output can be done with a case statement, I think?

Hello

Thank you.

Let me make sure I understand: If a player on two or more teams, the one with the largest value of the sequence appears in the column team_name. Others will be displayed, in the order of sequence, in the points column.

This done:

WITH     gb1     AS
(
     SELECT     player_id, player_name, team_name, sequence
     ,     SUM (points)          AS sum_points
     ,     ROW_NUMBER () OVER ( PARTITION BY player_id, player_name
                               ORDER BY         sequence   DESC
                       )   AS r_sequence
     ,     STRAGG (' ' || SUM (points) || ' for ' || team_name)
              OVER ( PARTITION BY  player_id, player_name
                      ORDER BY        sequence
                )  AS all_points
     FROM     game
     GROUP BY  player_id, player_name, team_name, sequence
)
SELECT    player_id
,         player_name
,         MIN (team_name)  KEEP (DENSE_RANK FIRST ORDER BY r_sequence)     AS team_name
,       TO_CHAR (SUM (sum_points))
       || MAX ( CASE
                      WHEN  r_sequence > 1
                 THEN  ' ('
                           || REGEXP_REPLACE ( SUBSTR (all_points, 2)
                                     , ' ,[^,]$'
                                )
                    || ')'
             END
                )  AS points
FROM          gb1
GROUP BY  player_id,            player_name
ORDER BY  player_id,            player_name;

The information listed in points (e.g. '(16 pour les TAUREAUX, 4 pour les PISTONS) ') requires the aggregation of the chain.
[AskTom.oracle.com | http://asktom.oracle.com/pls/asktom/f?p=100: 11:0:P11_QUESTION_ID:2196162600402] shows several ways to do so.
I used the first option on this page, the function defined by the user STRAGG, that you can copy from this page.

You can have a similar function, the WM_CONCAT (property WMSYS), already installed.
WM_CONCAT is not documented, so you can't use it in your Production applications.

Tags: Database

Similar Questions

  • How to highlight a cell IR report based on a value in another column?

    I used the code below and the cell is highlighted for all use column formatting css #COLTOHIGHLIGHT #add to pageBut what I need is if the HIDDENCOL is 'OUT' value and Custom2 should apply if the HIDDENCOL has value 'IN' then custom1 should apply. How to do? Please help thanks loly

    Sinduja Sivasailam wrote:

    Thank you for your contributions. I understand the concern.

    As suggested, I've reproduced the problem in the environment of the APEX.

    Thanks for making the effort. I suggest the following approach, which is more flexible and allows a more efficient use of the separation of concerns as above. I created an example on a new page to illustrate this.

    1. change the report query to

    select
        jan
      , feb
      , mar
      , jan_st
      , feb_st
      , mar_st
    from
        project_status
    

    2. in the report, set the month columns to display text and status columns to be hidden.

    3. set the property Expression of HTML for each column of months to use a HTML data attribute to include metadata status as well as the displayed value:

    #JAN#
    

    4. create a dynamic action after Refresh on the IR region to retrieve the status of project code in the columns of months and apply it as a class to the cell of report element:

    Event: After refresh

    Selection type: Region

    Region:

    Real Actions

    Sequence: 10

    Action: Run the JavaScript Code

    Fire on Page load: Yes

    Code

    $('.a-IRR-table td [data-prj-status]').each(function () {
      var x = $(this);
      x.parent().addClass(x.data('prjStatus'));
    });
    

    5 Add a style sheet to the page of Inline CSS property with a rule to set the background color of cell as required for each State of the project:

    .a-IRR-table tr:hover td {
      opacity: 0.7;
      transition: opacity .1s
    }
    .a-IRR-table td.REQ,
    .a-IRR-table tr:hover td.REQ {
      background-color: #ff9;
    }
    .a-IRR-table td.INP,
    .a-IRR-table tr:hover td.INP {
      background-color: #cf9;
    }
    .a-IRR-table td.YTS,
    .a-IRR-table tr:hover td.YTS {
      background-color: #ccf;
    }
    .a-IRR-table td.CR,
    .a-IRR-table tr:hover td.CR {
      background-color: #f66;
    }
    .a-IRR-table td.COM,
    .a-IRR-table tr:hover td.COM {
      background-color: #9cf;
    }
    
  • How to merge values into a line, based on distinct values in another column

    I have a table like

    updatedby updateddate text
    Approval John 1st May 2009 1 added file
    Approval of John 1 May 2009 2 added file
    May 2, 2009 1 deleted David approval form

    I need the text column values to be concatenated and displayed for unique (updatedby updateddate) records. The output is something like

    updatedby updateddate text
    Approval of May 1, 2009 John save further approval 1 sheet, 2 added
    May 2, 2009 1 deleted David approval form

    I had planned to do it using PLSQL. Is there a way to achieve this in SQl...? Please suggest
    SQL> ed
    Wrote file afiedt.buf
    
      1  with t as (select 'John' as updatedby, to_date('01-May-2009','DD-MON-YYYY') as updateddate, 'Approval record 1 added' as text from dual union all
      2             select 'John', to_date('01-May-2009','DD-MON-YYYY'), 'Approval record 2 added' from dual union all
      3             select 'David', to_date('02-May-2009','DD-MON-YYYY'), 'Approval record 1 removed' from dual)
      4  -- END OF SAMPLE DATA
      5  --
      6  select updatedby, updateddate, ltrim(sys_connect_by_path(text,','),',') as text
      7  from (
      8    select updatedby, updateddate, text, row_number() over (partition by updatedby, updateddate order by text) as rn
      9    from t
     10    )
     11  where connect_by_isleaf = 1
     12  connect by rn = prior rn+1 and updatedby = prior updatedby and updateddate = prior updateddate
     13  start with rn = 1
     14* order by 2
    SQL> /
    
    UPDAT UPDATEDDA TEXT
    ----- --------- ----------------------------------------------------------------------------------------------------
    John  01-MAY-09 Approval record 1 added,Approval record 2 added
    David 02-MAY-09 Approval record 1 removed
    
    SQL>
    

    Edited by: BluShadow May 21, 2009 12:37
    Argh! hair to the pole by SY

  • State of color lines based on a value in the same row

    I would like to color report lines based on a value in the same row.

    For bolting with the table 'EMP ':

    I would like job = MANAGER and Red work = CLERK to be green etc etc.

    The other example I found was the possibility of a single color either the nail or the default color.

    I'm looking for a way to do multiple colors.

    Hello

    In the model line, you can use #1 #, 2 # #, etc. to indicate where a field in the report should be released. It doesn't have to be clear - that is to say, you can use it in style tags if you wish.

    So take a query such as:

    SELECT EMPNO,
    ENAME,
    DEPTNO,
    DECODE(DEPTNO, 10, 'green', 20, 'red', 30, 'cyan', 'white') BG_COLOUR
    FROM EMP
    

    You get the column 1 = empno, 2 = ename, 3 = deptno and 4 = bg_colour. In the model line, you can then do:

    Before defining lines (implements the table):

    <table>
    <tr><td>ID</td><td>Name</td><td>Dept</td></tr>
    

    After setting (farm table) lines:

    </table>
    

    Model 1 (used for all lines) line:

    <tr style="background-color:#4#;"><td>#1#</td><td>#2#</td><td>#3#</td></tr>
    

    Then, for each row, the color that has been calculated by using the DECODE function is used in the style tag for color the background of the whole line.

    How to determine the colors, it's you. I used DECODE here, but you can use a field on the DEPT table to hold and use it in your SQL statement.

    Andy

  • SQL question - aggregate rows based on the value of the columns

    Hi all

    DBA_EXTENTS reports on the number of starting point of measurement (column BLOCK_ID) and the size of the scale in the Oracle (BLOCKS column) blocks.

    I'm trying to combine the lines of the segments of same as if their associated extensions are adjacent.

    For example, assume that the data in the view are as follows:

    Nom_segment Block_id BLOCKS
    EMP108
    EMP188
    DEPARTMENTS2616
    DEPARTMENTS428

    EMP

    5016EMP668

    And I want to do a set of results that looks like this:

    Nom_segment Block_id BLOCKS
    EMP1016
    DEPARTMENTS2624
    EMP5016

    I thought to use an analytical query, but I couldn't find something that meets this requirement.

    Can you please help?

    Hello

    Here's a way to do that using the analytical SUM function:

    WITH got_grp AS

    (

    SELECT nom_segment, block_id, blocks

    , block_id - SUM (blocks) over (PARTITION BY nom_segment

    ORDER BY block_id

    ) AS the grp

    FROM the data

    )

    SELECT nom_segment

    MIN (block_id) AS grp_block_id

    SUM (blocks) AS grp_blocks

    OF got_grp

    GROUP BY nom_segment, grp

    ORDER BY grp_block_id

    ;

    The data you posted in response to #3:

    Pini Dibask wrote:

    Thanks Frank,.

    If you would care to post CREATE TABLE and INSERT to your sample data and the version of your database, then I could show you exactly.

    The Oracle version is 11.2.0.4

    This is the CREATE TABLE and INSERT statements for the sample data:

    CREATE THE TABLE DATA (NOM_SEGMENT VARCHAR2 (20), BLOCK_ID NUMBER, NUMBER OF BLOCKS);

    INSERT IN DATA VALUES ("EMP", 10, 8);

    INSERT IN DATA VALUES ("EMP", 18: 8);

    INSERT IN DATA VALUES ("DEPARTMENTS", 28, 16);

    INSERT IN DATA VALUES ("DEPARTMENTS", 42, 8);

    INSERT IN DATA VALUES ("EMP", 50, 8);

    INSERT IN DATA VALUES ("EMP", 66, 8);

    is not the same as the data in your first post and the results are not the same, either.

    The fixed difference technique involves lines don't overlap.  In the sample data in response #3, 'DEPARTMENTS' lines overlap, i.e. blocks 42 and 43 belong to two segments.

  • Selectively hiding a row in a Table based on the value of the column

    I have a data control that is populated from pro-grammatically, based on the user's selection in the page one of wanting to hide some lines on page 2 at the same time, I don't want to delete the value binding, is there to hide the lines instead of column?

    To the table of the ADF, to hide the lines according to the requirement, use the visible property on each of the columns.

    For example, if you do not want to display all the lines that have IDs Director like 200 or 201.

     
                            
                                
                                    
                                
                            
                            
                                
                            
                            
                                
                            
                            
                                
                            
                        
    

    Thank you
    Nini

  • How to replace the value of a column in a table based on the value in the second column?

    Hi, I would like to find in a table 2D for values that meet certain criteria (for example, a column< 0.98).=""  based="" on="" which="" rows="" meet="" this="" criteria,="" i="" want="" to="" replace="" the="" values="" in="" a="" different="" column="" of="" the="" array="" (change="" to="" 'nan'="" so="" that="" the="" values="" will="" not="" be="" included="" in="" any="" calculations="" on="" that="" column,="" for="" example="" the="" finding="" the="" mean).=""  i've="" attached="" a="" sample="" .csv="" file.=""  if="" the="" values="" in="" column="" 3="" (index="" 2)="" are="" less="" than="" 0.980="" (or="" some="" other="" user="" defined="" value),="" then="" the="" value="" in="" column="" 2="" (index="" 1)="" should="" be="" replaced="" with="" nan.=""  can="" someone="" help="" out="" with="" this="" search="" and="" replace="">

    Thank you

    Keith

    (using LV 2009 SP1)

    A few quick hits.

    You can merge the two for loops

    You have not need one of the constants 1 and 2 in the index table.  They will solve automatically when you expand on the index picture, once you have wired to 0 in the column index.

    It seems a lot of handling additional table spent unnecessarily.

    See below.  I did not try to duplicate your code to see how it actually works, but I believe that I have attached will give the same result with less steps.

  • How to get the total number of occurrences based on the value of a column.

    Hi all

    It is the first time I'll ask the question here on your forum, but since then followed several threads. I guess it's now my turn to ask a question. Anyway here's the thing, I have a query that should return to count the number of rows based on the value of HOUSING. Something like this:

    -----
    WIPDATAVALUE          SLOT             N            M
    1-2                   TRALTEST43S1     1            3
    1-2                   TRALTEST43S1     2            3
    3                     TRALTEST43S1     3            3
    4-6                   TRALTEST43S2     1            4
    4-6                   TRALTEST43S2     2            4
    4-6                   TRALTEST43S2     3            4
    7                     TRALTEST43S2     4            4
    -----

    As you can see above, on the TRALTEST43S1 of the SLOT, there are three occurrences, so M (Total number of occurrences) must be three and this column N he's counting. It is the same with the TRALTEST43S2 of the SLOT. It's the query I have so far:
    SELECT DISTINCT
    WIPDATAVALUE, SLOT
    , LEVEL AS n
    , m 
    FROM
    (
      SELECT
        WIPDATAVALUE
        , SLOT
        , (dulo - una) + 1 AS m 
      FROM
      (
        SELECT 
          WIPDATAVALUE
          , SLOT
          , CASE WHEN INSTR(wipdatavalue, '-') = 0 THEN wipdatavalue ELSE SUBSTR(wipdatavalue, 1, INSTR(wipdatavalue, '-')-1) END AS una
          , CASE WHEN INSTR(wipdatavalue, '-') = 0 THEN wipdatavalue ELSE SUBSTR(wipdatavalue, INSTR(wipdatavalue, '-') + 1) END AS dulo
        FROM trprinting
        WHERE (containername = :lotID OR SLOT= :lotID) AND WIPDATAVALUE LIKE :wip
      )
    ) CONNECT BY LEVEL <= m
    ORDER BY wipdatavalue;
    And it leads to something like this:
    -----
    WIPDATAVALUE          SLOT             N            M
    1-2                   TRALTEST43S1     1            2
    1-2                   TRALTEST43S1     2            2
    3                     TRALTEST43S1     1            1
    4-6                   TRALTEST43S2     1            3
    4-6                   TRALTEST43S2     2            3
    4-6                   TRALTEST43S2     3            3
    7                     TRALTEST43S2     1            1
    -----

    I think that my current query based results M and N on WIPDATAVALUE and not HOUSING that's why I get the wrong result. I also tried to use WITH instruction and it works well, but unfortunately, our system cannot accept the subquery factoring.

    I know that you guys will be of help because you are all awesome. Thank you all

    Published by: 1001275 on April 19, 2013 20:07

    Published by: 1001275 on April 19, 2013 20:18

    Hello

    1001275 wrote:
    Hi sb92075,

    You are right that it is available with this version. But our system doesn't put queries that use subquery factoring.

    What system are you talking about? If you really have something that prevents you from using all the features of Oacle, you should seriously think about fixing it.

    Any other ideas on how we can do this without help WITH clause?

    Yes; If a WITH clause is referenced that once, it can be re-written as a point of view online:

    SELECT       wipdatavalue
    ,       slot
    ,       ROW_NUMBER () OVER ( PARTITION BY  slot
                                 ORDER BY          low_number
                        )                    AS m
    ,       COUNT (*)     OVER ( PARTITION BY  slot )     AS n
    FROM       (     -- Begin in-line view (got_numbers)
                SELECT     wipdatavalue
              ,     slot
              ,     TO_NUMBER ( SUBSTR ( wipdatavalue
                                        , 1
                                   , INSTR ( wipdatavalue || '-'
                                               , '-'
                                        ) - 1
                                   )
                            )          AS low_number
              ,     TO_NUMBER ( SUBSTR ( wipdatavalue
                                        , 1 + INSTR ( wipdatavalue
                                                       , '-'
                                                )
                                   )
                            )          AS high_number
              FROM     trprinting
           )     -- End  in-line view got_numbers
    CONNECT BY     LEVEL               <= high_number + 1 - low_number
         AND     low_number          = PRIOR low_number
         AND     PRIOR SYS_GUID ()      IS NOT NULL
    ORDER BY  low_number
    ,            m
    ;
    
  • In the form of table-update of rows based on the selection of the checkbox

    Hi all

    I have a tabular layout with line selector. I need to update manually checked columns, how would write a process audited records updated?

    Something like this:
    BEGIN     
         FOR i in 1..apex_application.g_f01.count LOOP
    
              IF apex_application.g_f01(i) is not null THEN
                   UPDATE TEST_USERS
                        set USER_ID = :P14_TO
                   WHERE rowid = :APEX$ROW_ID;
                   COMMIT;
              END IF;
         END LOOP;
    END;
    Thank you very much.

    You can refer to the line that you want to process through the value stored in the box.

    If you use apex_application.g_f01 (i) to make reference to the line and you want to update the row based on the ROWID in your request, your SQL query should have the box as follows:

    apex_item. CheckBox2 (1, rowid)

    Then your PLSQL process would be like this:

    BEGIN
         FOR i in 1..apex_application.g_f01.count LOOP
    
              IF apex_application.g_f01(i) is not null THEN
                   UPDATE TEST_USERS
                        set USER_ID = :P14_TO
                   WHERE rowid = APEX_APPLICATION.G_F01(i);
                   COMMIT;
              END IF;
         END LOOP;
    END;
    

    I hope this helps.

    Cheers, Pete

  • Conditionally display the values in the column based on another column

    Hello

    I'm sure this has been covered before, but I can't find anything appropriate based on the research I've done.

    I have 2 attributes in VO.

    I have a table that displays this VO.

    I still want to display header for both attributes, but I only want to show the value of attribute 1 in a row, if value of Attibute2 = 'I '.

    If Attibute2! = 'I', so I want just the column for Attribute1 to be empty space.

    I've not yet done anything with conditional expressions, and I wonder if someone could provide a link or a thread which is similar to this issue.

    Thank you

    Joel

    You can do according to the post above, but if you are not interested in changing the original Version and I want to just change the user interface page only, you can do as in the example below:


    lines = ' #{bindings. " Employee.rangeSize}.
    emptyText = "#{bindings." Employee.Viewable? "{'No data to display.': 'Access Denied.'}".
    fetchSize = "#{bindings." Employee.rangeSize}.
    rowBandingInterval = '0 '.
    selectedRowKeys = ' #{bindings. " Employee.collectionModel.selectedRow}.
    selectionListener = "#{bindings." Employee.collectionModel.makeCurrent}.
    rowSelection = "single" id = "t1" >

    headerText = "#{bindings." Employee.hints.Employeeid.label}.
    ID = "c2" >


    model = ' #{bindings. " Employee.hints.Employeeid.format}"/ >



    headerText = "#{bindings." Employee.hints.Employeename.label}.
    ID = 'c3' >



    headerText = "#{bindings." Employee.hints.Salary.label}.
    ID = "c1" >
    *
    ID = "ot2" >

    model = ' #{bindings. " Employee.hints.Salary.format}"/ >


    OutputText for the Attibute1, you can write the EL expression as:
    *<>
    * value = "#{rank." Attibute2 == "I"? "line. "{Attibute1:"}. "
    * id = "ot2" > *.

    I hope this helps.

    Thank you
    Nini

  • The line formatting based on the value of a column

    Hi friends

    I'm trying to format the entire row based on the value of the first column in my answers.

    Example, if the first value of column 'F' now, I want the row to be colorful

    I can do a conditional formatting on a column, but I want to do down the line

    F 8.1% 12.0%
    ------------------------------------------
    E 5.2% 3.5%
    ------------------------------------------
    M 2.3% 3.3%
    ------------------------------------------


    If one has done this or suggestions please answer

    Thank you
    Sang A

    Well, the conditional formatting can be done in PivotTables until the next version, 11g. In the meantime, you two options:

    (1) http://gerardnico.com/weblog/2009/04/06/obiee-cross-conditional-formatting-on-a-pivot/

    (2) http://oraclebizint.wordpress.com/2008/04/29/oracle-bi-ee-101332-conditional-formatting-based-on-multiple-character-columns-in-a-pivot-table/

    (3) you can use your custom column filter functionality to get your ' sales in year 20xx "and a presentation to make this dynamic variable. So you can declare an array and use the method I described above.

    filters on columns

    Good luck.

  • How to highlight the line of the ADF table based on the value of the column?

    Hi all

    I use jdev 10.1.3.4. I want to highlight a table row or a cell based on the value of the column.

    Lets say, I have a table emp with column empid, empname and sal. I want to emphasize the lines that have sal = 10000.

    How can I achieve this? Please help me with this.

    Thank you
    Abhijit

    Hello

    You want to highlight the lines? or set a different color for the lines? If it's the second, you can set the inline style based on the salary. (+ Edit: well, never mind, both are same :)) +)

    Something like

    
    

    If you want the entire line to be a different color, you have 2 options.

    1. define the same style inline for all columns in the table (good if you want to do only for a single table).
    2. create a style class and apply the styleclass based on the value of sal (preferably if you want the same behavior in all of your application).

    Arun-

    Published by: joel Ramamoorthy, October 23, 2009 16:56

  • Display the name of the tag as the column name and the value in the tag as a row of data from the input string.

    Hi Forum members,

    I am looking for a query display the name of the tag as the column name and the value in the tag as a row of data.

    I have to print the values within the tag to a file by choosing the value of the flags. the sequence of the tags will vary each time, as the tag name will change dynamically.

    So here is the example of input data and the expected output. The string in the text column must be separated as the column names and values.

    Input data
    Select 1 as seqno,' < > 0210A 50 4f < / 4f > < 5f20 > TEST CARD 16 < / 5f20 > < 5f2a > < / 5f2a > < 82 > 1 c 00 < / 82 > ' double text


    Output:

    Seqno 4f 5f20 5f2a 82
    0210A 50 16 1 00 TEST CARD 1

    Please help me by providing your entries on this.

    We use the version of Oracle 11.2.

    Note: This is not the XML string

    Thank you

    Shree

    with

    data in the form of

    (select 1 as seqno,'<4f>0210 A 50<5f20>TEST CARD 16<5F2a><82>00 1' text of all the double union)

    Select 2 as seqno,'XYZ<4F>0210 A 50<5f20>TEST CARD 16<5f2a><82>00 1' text of all the double union

    Select 3 as seqno,'<4f>0210 A 50<5f20>TEST CARD 16<5F2A><82>1 00XYZ ' text of all the double union

    Select option 4 as seqno,'<4F>0210 A 50<5F20>TEST CARD 16<5f2A><82>1 00XYZ' double text

    )

    Select d.seqno, x.*

    d the data,

    XMLTable ('/ root')

    by the way xmltransform (xmltype ('': replace (replace (text,'<><>'),)))

    XmlType (q'~http://www.w3.org/1999/XSL/Transform "version ="1.0"> ")

                                                     

                                                       

                                                         

                                                       

                                                     

                                                     

                                                       

                                                         

                                                       

                                                     

    ~'

    )

    )

    path of columns '4f' varchar2 (10) "tag4f."

    path of "5f20' varchar2 (30)"tag5f20. "

    path of '5f2a' varchar2 (10) "tag5f2a."

    path of varchar2 (10) "82" "tag82.

    ) x


    SEQNO 4f 5f20 5f2a 82
    1 0210A 50 16 TEST CARD - 1 00
    2 0210A 50 16 TEST CARD - 1 00
    3 0210A 50 16 TEST CARD - 1 00
    4 0210A 50 16 TEST CARD - 1 00

    with

    data in the form of

    (select 1 as seqno,'<4f>0210 A 50<5f20>TEST CARD 16<5F2a><82>00 1' text of all the double union)

    Select 2 as seqno,'XYZ<4F>0210 A 50<5f20>TEST CARD 16<5f2a><82>00 1' text of all the double union

    Select 3 as seqno,'<4f>0210 A 50<5f20>TEST CARD 16<5F2A><82>1 00XYZ ' text of all the double union

    Select option 4 as seqno,'<4F>0210 A 50<5F20>TEST CARD 16<5f2A><82>1 00XYZ' double text

    ),

    Chopper (seqno, Key, value, String) as

    (select seqno,

    regexp_substr (text,'<(.+?)>', 1, 1, null, 1),

    regexp_substr (Text,'>(.*?))

    regexp_substr (text,'<.+?>. *? ) (.*) $', 1, 1, null, 1). » <>'

    from the data

    Union of all the

    Select seqno,

    regexp_substr (String,'<(.+?)>', 1, 1, null, 1),

    regexp_substr (String,'>(.*?))

    regexp_substr (String,'<.+?>. *? ) (.*) $', 1, 1, null, 1)

    Chopper

    where regexp_substr (string,'<(.*?)>', 1, 1, null, 1) is not null

    )

    Select '4f', seqno, '5f2a', '82', '5f20.

    of (seqno, lower (key) select key, value)

    Chopper

    )

    Pivot (max (value) for key in ('4f' as '4f', '5f20' as '5f20', '5f2a' as '5f2a', "82" as "82"))

    Concerning

    Etbin

  • Display the value of the column automatically based on another column in a table

    Hello

    I use APEX 5.0, I have a requirement to display the field automatically based on the tabular presentation of other numbers.

    img.png

    in the screen shot attached above when I press Add button line a new line is created and enter the value in 'place no.', 'dept and identification of height place' when I press tab or get out of the column "height", "GID" should appear automatically.

    To display the GID my query will be like that. "Select GID from x where no = '1011' place and dept = 88 and height = 88'.

    How to get the value of from GID of the another value entered in Place no, dept and height in tabular form.

    Thanks in advance

    Ravi.

    Hi Ravi

    No need to point of Application or process. I just completed the task with the following steps

    (1) create 4 hidden items

    P2_SELWID

    P2_SELDEPTH

    P2_SELHEIGHT

    P2_CALCWNAME

    (2) gives 3 CSS classes in three columns of tables.

    . WID

    . DEPTH

    . HEIGHT

    (3) create the function jQuery for re - get three items from the page on a line if one of them has been changed.

    Add the following code to the function and the declaration of global variables

    function setRowItemValues(p_rownum){
        wid_col_id = 'f02_' + rownum ;
        wid_col_val = $('#'+wid_col_id).val();
        depth_col_id = 'f03_' + rownum ;
        depth_col_val = $('#'+depth_col_id).val();
        height_col_id = 'f04_' + rownum;
        height_col_val = $('#'+height_col_id).val();
        wname_col_id = 'f05_' + rownum;
        // set P2_SELWID,P2_SELDEPTH,P2_SELHEIGHT
        $s("P2_SELWID", wid_col_val );
        $s("P2_SELDEPTH", depth_col_val );
        $s("P2_SELHEIGHT", height_col_val );
        $s("P2_SELWNAMEID", wname_col_id );
        // Call the Dynamic Action to get WNAME if all values are not null
        if( wid_col_val != ''  && depth_col_val != '' && height_col_val != '' ){
            //Call DA to Get WNAME from WINT
            $.event.trigger("CalcWNAME");
            // set the Tabular form
            $('#'+wname_col_id).val($x("P2_CALCWNAME").value);
        }
    }
    

    and run when the Page loads

    $(document).on("change", ".WID,.DEPTH,.HEIGHT", function(){
        rownum = $(this).attr('id').substr(4);
        setRowItemValues(rownum);
    });
    

    (4) create a dynamic Action to get WNAME based on a PL/SQL function. Note the submitted page elements.

    CalcWNAME

    (5) set of the corresponding element in the line of the function jQuery, after completing the DA.

    Please check and I hope your problem is now solved.

    Concerning

    Mahmoud

  • How to map the entered value of attribute column to another attribute in the table for each row.

    Hi Experts ADF,

    JDev 12 c.

    I create a button and a table below. If the user clicks on the button create, I invoke CreateInsert. The new line now appears as an editable fields.

    So I suppose I have a column that is displayed in editable mode. If the user enters values in that. Has another column B whose value is not displayed in the UI must have the same value as the column.

    This occurs for each row added. During the click on save if user entered 2 in column A, then the value in column B must be same 2.

    Thank you

    Roy

    There is more than one way, for example:

    Generate ViewRowImpl Java class (with generate audited accessors) you will get for an attribute setter.

    Change the Set accessor to set the attribute B (IE, calling setAttribute ("B", value)) after setting a value

    OR, write valueChangeListener for inputText representative and set the B attribute to the same value

Maybe you are looking for