With a many to many relationship data in a table - recursive sql?

Hello
I'm trying to group data associated with a many to many relationships in a number of unique group using SQL only. The table looks like this.

AMOUNT OF THE CHECK PLAN

1 10
A 15 2
2 11 B
3 12 B
4 13 B
4 16 C
5 17 D

The result should look like this. Since A is linked to 2, 1 and 2 correspond to the B and B are related to 3 and 4, 4 is related to C, these lines should be considered as a group. Any direction on where I should start looking for or if there is no function of Oracle that will be much appreciated. The version of oracle's 10g.

CHECK THE PLAN AMOUNT GROUPID

1-10-1
2-15-1
2 11 1 B
3 12 1 B
1 13 4 B
4-16-1 C
5 17 2 D



CREATE THE TABLE PAS_DBA. GRPDEL
(
CHECKID VARCHAR2 (5 BYTE),
PLAN OF INTEGER,
AMOUNT NUMBER (6.2)
);

TOGETHER TO DEFINE
Insert into PAS_DBA. GRPDEL
(CHECKID, PLAN, SUM)
Values
('A', 1, 10);
Insert into PAS_DBA. GRPDEL
(CHECKID, PLAN, SUM)
Values
('A', 2, 15);
Insert into PAS_DBA. GRPDEL
(CHECKID, PLAN, SUM)
Values
("B", 2, 11);
Insert into PAS_DBA. GRPDEL
(CHECKID, PLAN, SUM)
Values
("B", 3, 12);
Insert into PAS_DBA. GRPDEL
(CHECKID, PLAN, SUM)
Values
("B", 4, 13);
Insert into PAS_DBA. GRPDEL
(CHECKID, PLAN, SUM)
Values
("C", 4, 16);
Insert into PAS_DBA. GRPDEL
(CHECKID, PLAN, SUM)
Values
(A ', 5, 17);
COMMIT;

Hello

Good thing you're uisng Oracle 10. I don't think you could do this in pure SQL using any earlier version, but the CONNECT BY NOCYCLE feature, introduced in Oracle 10, makes this possible.

WITH     got_groupname     AS
(
     SELECT     checkid, plan, amount
     ,     MIN (CONNECT_BY_ROOT checkid)     AS groupname
     FROM     grpdel
     CONNECT BY NOCYCLE     (     checkid     =  PRIOR checkid
                       AND     plan     != PRIOR plan
                    )
               OR     (     checkid != PRIOR checkid
                    AND     plan     =  PRIOR plan
                    )
     GROUP BY  checkid, plan, amount
)
SELECT       g.*
,       DENSE_RANK () OVER (ORDER BY groupname)     groupid
FROM       got_groupname      g
ORDER BY  checkid
,            plan
;

Output:

CHECK PLAN AMOUNT GROUPNAME GROUPID
----- ---- ------ --------- -------
A        1     10 A               1
A        2     15 A               1
B        2     11 A               1
B        3     12 A               1
B        4     13 A               1
C        4     16 A               1
D        5     17 D               2

You did not ask the groupname column, but I realized just to help show how it works. The subquery got_groupname associates each checkid with each other the checkid, regardless how many not deleted the two lines are. MIN finds the lowest checkid that each is bound, which generates a unique group identifier. Personally, I sould like usage of groupname as identifier. It tells you in the blink of an eye that B is a member of the same group has. However, it is not the same as that of a certain number, so if you need a number, you can derive from groupname with the analytical DENSE_RANK function.
In many versions of Oracle, CONNECT BY queries do not work properly if they contain functions analyric. I don't know if this is the case in your version, but I don't think it's worth taking a chance. By CONNECT BY in a subquery no analytical function and then by the analytical function in a super-requete, we eliminate any chance of such a conflict.

Thanks for posting the CREATE TABLE and INSERT statements; It is very useful.
You want to be more useful? Do not publish the name of schema, PAS_DBA. Not many people who want to help you have a schema called PAS_DBA, and they probably won't create a. He probably doesn't. ' t help, either; probably, you connect PAS_DBA to create the table in any case.

Tags: Database

Similar Questions

  • Kindly help me with the request to find the data in two tables

    Hello Guru

    Kindly help me to recover the data from two tables-

    BASEBALL
    LEGAL_ENT_ID (PK)
    GAME_ID (FK)
    LEGAL_ENT_NM
    INACTIVE_DT
    DATE OF INS_TS
    INS_LOGIN
    DATE OF UPD_TS
    UPD_LOGIN


    FOOTBALL
    GAME_ID (PK)
    BRKR_NM,
    BRKR_ISR_ID
    BROKER_SYMBOL
    INACTIVE_DT
    BRKR_SWIFT_FLG
    BRKR_INTERNAL_FLG
    BRKR_CATEGORY
    UPD_TS
    MINORITY_FLG
    BROKER_TYP
    STATUS
    INS_TS
    INS_LOGIN
    UPD_LOGIN
    APP_USER
    ACTIVE_FLG

    and if I want fecth data from these two tables according to the following condition then it is fine with the suite of applications.

    1 select distinct values only table of BASEBALL by using the following query.

    SELECT DISTINCT B.GAME_ID as 'CLEARING GAME ID', B.BRKR_NM "NAME of THE GAME of COMPENSATION" OF BASEBALL A, FOOTBALL B WHERE A.BROKER_RELATION_CD IN ('FUTBRKR1', 'FUTBRKR2') AND A.GAME_ID = B.GAME_ID

    2 Select all the table BRKR_NM OF FOOTBALL as well by using the query - next

    SELECT GAME_ID "RUNNING GAME ID", 'NAME OF THE GAME OF EXECUTION' BRKR_NM SOCCER

    Now, my query is that--

    I want a query that gives me a combination of above mentioned queries... and if I tried to use Union or Union All, then she is not giving me the result as expected.

    I like the result to look like who has a few conditions such as -
    1 - the records in the table Football are high vs Baseball table because there is no condition to filter the records of the Football.
    2 - football is a superset of records and Baseball is a subset.
    3 - COMPENSATION NOM_JEU and RUNNING NOM_JEU may return the same values as well.

    I want the result to be in the following form-

    EXECUTION ID GAME | NAME OF THE GAME TO RUN. COMPENSATION ID GAME | DELETE THE NAME OF THE GAME.
    2123 test1 2345 test5
    2456 test10 2456 test10


    Thanks in advance. Kindly help me.

    Published by: user555994 on January 4, 2011 23:48

    In the output you want.
    All the values of baseball;
    Values of football that are matched;
    But on what condition you want to match?

  • XML data in the table using sql/plsql

    Hi experts,

    Could you please help with the following requirement. I have the tags xml (.xml on a server file) below. I need to access this file and read the XML and insert into the db table using sql and plsql. Is it possible with the cdata below? And there is a nested this table.

    Could someone please guide me if you have a sample code file and xml.

    <? XML version = "1.0" encoding = "UTF-8"? >

    < generation_date > <! [CDATA [17/11/2015]] > < / generation_date >

    < generated_by > <! [CDATA [Admin Admin]] > < / generated_by >

    < year > <! [CDATA [2015]] > < / year >

    < month > <! [CDATA [01]] > < / month >

    < author >

    < author > <! [CDATA [user author]] > < / author > < author_initial > <! [CDATA [user]] > < / author_firstname > < author_country > <! [CDATA [author]] > < / author_lastname >

    < author_email > <! [CDATA [[email protected]]] > < / author_email >

    < author_data_01 > <! [CDATA []] > < / author_data_01 >

    < author_data_02 > <! [CDATA []] > < / author_data_02 >

    < items >

    < article_item >

    < article_id > <! [CDATA [123456]] > < / article_id >

    < publication > <! [CDATA [Al Bayan]] > < / publication >

    < section > <! [CDATA [Local]] > < / section >

    < issue_date > <! [CDATA [11/11/2015]] > < / issue_date >

    < page > <! [CDATA [2]] > < / print this page >

    < article_title > <! [CDATA [title.]] > < / article_title > < number_of_words > <! [CDATA [165]] > < / number_of_words >

    < original_price > <! [CDATA [200]] > < / original_price >

    < original_price_currency > <! [CDATA [DEA]] > < / original_price_currency >

    < price > <! [CDATA [250]] > < / price >

    < price_currency > <! [CDATA [DEA]] > < / price_currency >

    < / article_item >

    < / articles >

    < total_amount > <! [CDATA [250]] > < / total_amount >

    < total_amount_currency > <! [CDATA [DEA]] > < / total_amount_currency >

    < / author >

    < / xml >

    Thanks in advance,

    Suman

    XMLTABLE using...

    SQL > ed
    A written file afiedt.buf

    1 with t (xml) as (select xmltype ('))
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    [[12 [email protected]]] >
    13
    14
    15
    16
    17
    18
    19


    20
    21
    22
    23
    24
    25
    26
    27
    28
    29
    30
    31
    32
    33 ") of the double)"
    34-

    35 end of sample data
    36-
    37 - assumptions:
    (38 - a) XML may have several tags
    (39 - b) each may contain more
    40-
    41 select x.gen_by, x.gen_date, x.mn, x.yr
    42, y.author, y.auth_fn, y.auth_ln, y.auth_cnt, y.auth_em, y.auth_d1, y.auth_d2

    43, z.id, z.pub, z.sec, z.iss_dt, z.pg, z.art_ttl, z.num_wrds, z.oprice, z.ocurr, z.price, z.curr
    44 t
    45, xmltable ('/ authxml')
    from $ 46 t.xml
    path of 47 columns gen_date varchar2 (10) '. / generation_date'
    48, path of varchar2 (15) of gen_by '. / generated_by'
    49, path of varchar2 (4) year '. "/ year"
    50 varchar2 (2) mn road '. "/ month"
    51, path of xmltype authors '.'
    52                 ) x
    53, xmltable ('/ authxml/authors ')
    from $ 54 x.authors
    author of 55 path of varchar2 columns (15) '. / author'
    56, path of varchar2 (10) of auth_fn '. / author_firstname'
    57, path of varchar2 (10) of auth_ln '. / author_lastname'
    58 road of VARCHAR2 (3) auth_cnt '. / author_country'
    59 road of varchar2 (20) of auth_em '. / author_email'
    60 road of varchar2 (5) of auth_d1 '. / author_data_01'
    61, path of varchar2 (5) of auth_d2 '. / author_data_02'
    62, path of xmltype articles '. / Articles'
    63                 ) y
    64, xmltable ('/ Articles/article_item ')
    from $ 65 y.articles
    path id 66 number columns '. / article_id'
    67, path of varchar2 (10) pub '. ' / publication.
    68 road of varchar2 (10) dry '. / section'
    69, path of varchar2 (10) of iss_dt '. / issue_date'
    70 road of VARCHAR2 (3) pg '. "/ print this page"
    71, path of varchar2 (20) of art_ttl '. / article_title'
    72, path of varchar2 (5) of num_wrds '. / number_of_words'
    73, path of varchar2 (5) of oprice '. / original_price'
    74 road to VARCHAR2 (3) ocurr '. / original_price_currency'
    75, path of varchar2 (5) price '. "/ price"
    76, path of VARCHAR2 (3) curr '. / price_currency'
    77*                ) z
    SQL > /.

    GEN_DATE GEN_BY YEAR MN AUTHOR AUTH_FN AUTH_LN AUT AUTH_EM AUTH_ AUTH_ ID PUB DRY ISS_DT PG ART_TTL NUM_W OPRIC HEARTS PRICE OCU
    ---------- --------------- ---- -- --------------- ---------- ---------- --- -------------------- ----- ----- ---------- ---------- ---------- ---------- --- -------------------- ----- ----- --- ----- ---
    17/11/2015 Admin Admin 2015 01 user author user author [email protected] 123456 UAE Al Bayan Local 11/11/2015 2 is the title.   165 200 AED AED 250

    Of course, you'll want to change the types of data, etc. as needed.

    I assumed that the XML can contain several "" sections and that each section can contain several entries.

    Thus the XMLTABLE aliasing as 'x' gives information of XML, and supplies the data associated with the XMLTABLE with alias 'y' which gets the multiple authors, which itself section of the XMLTABLE with alias 'z' for each of the article_item.

    CDATA stuff are handled automatically by SQLX (XML functionality integrated into Oracle's SQL)

  • wanted to extract data from nested table pl/sql Ref Cursor getting an erro

    create or replace type 'DEPT12' as an object (dno number (2), dname varchar2 (30), varchar2 (50)) loc;

    create or replace type dept_tab in the table in "DEPT12".

    create or replace type 'LOC12' as an object (locno number, loc_name varchar2 (100))

    create or replace type loc_tab in the table of "LOC12.

    create or replace type dept_loc_rec1 as an object (dept_tab, eno number, loc_dt loc_tab dept_dt);

    Create type dept_loc_tb as table of the dept_loc_rec1

    create table dept_loc_tb_bk1 (dept_dt dept_tab, eno number, loc_dt loc_tab)
    NESTED TABLE dept_dt
    STORE AS dept_tab12,
    NESTED TABLE loc_dt
    STORE AS loc_tab12




    insert into dept_loc_tb_bk1 values (dept_tab (dept12(3,'ABD','LOC')
    dept12(4,'ABD','LOC')
    (, dept12(5,'ABD','LOC')), 3, loc_tab (loc12(21,'AAB'),
    loc12(22,'AAB'),
    loc12(23,'AAB')));

    When I try to extract data from Ref cursor to pl/sql table that I get an error ora-06504: pl/sql: return types of the result set of variables or request do not match.
    I created a table nested, as well as the pl/sql nested table object dept_loc_tb and I said the same dept_loc_tb lv_dept_loc_tb, but trying to get in this variable we get an error above.

    Please anyone can solve my problem.
    -----------------
    declare
    type cr is ref cursor;
    cr_obj cr;

    lv_dept_loc_tb dept_loc_tb;

    Start
    Open cr_obj to select dept_dt, eno, dept_loc_tb_bk1 loc_dt;
    collect the fetch cr_obj in bulk in lv_dept_loc_tb;
    close cr_obj;
    end;

    Your query selects 3 distinct columns requires so 3 collections of matching types. You want to treat these 3 columns as an object of type DEPT_LOC_REC1:

    SQL> declare
      2  type cr is ref cursor;
      3  cr_obj cr;
      4
      5  lv_dept_loc_tb dept_loc_tb;
      6
      7  begin
      8  open cr_obj for select dept_dt,eno,loc_dt from dept_loc_tb_bk1;
      9  fetch cr_obj bulk collect into lv_dept_loc_tb;
     10  close cr_obj;
     11  end;
     12  /
    declare
    *
    ERROR at line 1:
    ORA-06504: PL/SQL: Return types of Result Set variables or query do not match
    ORA-06512: at line 9
    
    SQL> declare
      2  type cr is ref cursor;
      3  cr_obj cr;
      4
      5  lv_dept_loc_tb dept_loc_tb;
      6
      7  begin
      8  open cr_obj for select DEPT_LOC_REC1(dept_dt,eno,loc_dt) from dept_loc_tb_bk1;
      9  fetch cr_obj bulk collect into lv_dept_loc_tb;
     10  close cr_obj;
     11  end;
     12  /
    
    PL/SQL procedure successfully completed.
    
    SQL> 
    

    SY.
    P.S. discover sys_refcursor.

  • Button insert data to the table

    Hello

    I use APEX 4.2.3 with XE, I try to insert data into the table using code below but nothing happen when I press the button, create this button like 'create a button to point to page'-> 'dynamic action'-> 'run pl/sql '.

    begin
    insert into dummy values('xx');
    commit;
    end;
    
    

    So to clarify, you have

    (1) created a button that "action" is "defined by the dynamic action.

    (2) created a dynamic action that executes pl/sql at the click on the button and you are pl/sql?

  • Cascading list of values with a many-to-many relationship

    Hi all

    I have three paintings; semester, subject and half of subject. Each semester has a lot of topics and a subject can be taught in several semesters.

    create table semester(
         id number not null,
         name varchar2(50) not null,
         primary key(id)
    );
    create table subject(
         id number not null,
         name varchar2(50) not not null,
         primary key(id)
    );
    create table semester_subject(
         id number not null,
         semester_id number not null,
         subject_id number not null,
         primary key(id),
         foreign key(semester_id) references semester(id),
         foreign key(subject_id) references subject(id),
         constraint semester_subject_uq unique(semester_id, subject_id)
    );
    
    

    EDIT: I have a page with a report that shows all students who are currently enrolled in the selected for the selected session object.

    There are two selection lists at the top of the report, one for the half and the other for the subject.

    What I try to do is when you select a semester in the half selection list, the topic selection list should contain only the subjects for the half of some (not all) in the subject of the painting.

    h

    If the relationship was of 1 to many that I could write to see half of value

    select name, id
    from semester
    order by 1
    
    

    and for the purpose of value list

    select name, id
    from subject
    where semester_id = :PX_SEMESTER
    
    

    But now that the relationship depends on the table of semester_subject, I can't find a way to achieve this and Googling has not helped.

    Thanks in advance for any help.

    I believe that this issue has also been implemented on stack overflow plsql - list of values cascading with many-to-many relationship - stack overflow and received a very wide response. If the OP has not yet verified, he may want to.

    (FYI: I'm not the person who answered there.)

  • Is an extra Associative entity automatically created when we do a lot of many relationships?

    Hello

    I use SQL DEVELOPER DATA MODELER Version 4.0.2.840.

    My question is when we create many to-many between two main entities let PRODUCT and SALES (master). then we want to create a table associative entity SALES_DETAIL (details of sales)

    Is there an option that allows me to create an associative entity automatically with two associations of old masters. As it is automatically created with TOAD DATAMODELER.

    Thank you.

    Hello

    many-to-many relationship is transformed into associative array / intersection during the engineering to the relational model. If you add attributes to the relationship that they will turn to the columns of this table. Use "Show > attributes of the relationship" in the context menu of the diagram so that they are visible on the diagram.

    Philippe

  • How to implement many of many relationships?

    I've been google searching for articles on the implementation of many-to-many relationships and find as many hits I'm swamped.
    Someone at - he preferred an article on this topic?

    In my example, I have a number to-many between the table 'user' and 'project' of the table.
    Why do some articles indicate that the primary key of the table of links 'UserProject' contains two foreign keys for 'user' and 'project '? If we want to find all projects for a given "user.id", we not specifying the "project.id". It will not be reduced in a linear search then?

    I thought we should receive the 'fk_user' foreign key as the primary key and create an index of the "fk_project" (or vice versa). So if we specify the "user.id" we can quickly find all the corresponding values of 'project.id '.

    There are oracle-specific issues I should know about?

    Thank you
    Siegfried

    As you guessed, a primary key is intended to preserve the unique character.
    If you have a composite primary key, so if you provide columns in the predicate (where clause) that are the primary key columns, then they can help you with an effective search.

    If you have a requirement that you have aquery that always uses the 2nd and 3rd in the columns of the primary key, but never the first column, then you might want to add a composite index on these two columns.

    Remove the referential integrity of a production database is pretty much one of the worst things you can do.
    Think about the consequences: you'll have records of children who do not have a parent record or worse have the incorrect parent record. It is best to not leave a record get in the database to allow incorrect data.

    Incorrect data are a nightmare to fix, as its very difficult to find the source, and worse still, it can remain unnoticed for years.

    Your mantra should be to avoid bad data in the database. This by applying constraints at the level of the database.
    This means that all data entered with conform to these rules.

  • one-to-many relationship

    Read the article here...

    http://www.databaseprimer.com/relationship_1tox.html

    To illustrate the one-to-many relationship consider the table of sampling plan and data below:
    authors table
    ============
    author_id (primary key)
    LastName
    FirstName
    book_id (foreign key - link to table books book_id)


    table Books
    ===========
    book_id (primary key)
    title
    author_id  lastname  firstname   ->     book_id  title
    ---------  --------  ---------   ->     -------  ------
    0001       henry     john        ->     0001     a database primer
                                            0002     building datawarehouse
                                            0003     teach yourself sql
    0002       johnson   mary        ->     0004     101 exotic recipes
    0003       bailey    harry       ->     0005     visiting europe
    0004       smith     adam
    then how the data on the "authors" table columns 'author_id' and 'book_d '?

    don't know how to frame the table 'authors '...

    It would become the relation 1-1... is it normal?

    Please help how data will be in the "authors" table

    Thank you

    You do not want to have a database template that you have illustrated below. Why? Well to start tt does not pass even the first normal form. Secondly, if you had ever updated the author's name, you will need to update in several places, which could lead to problems of data integrity. A database designed to reduce redundancy, the structure that you have proposed increases it.

    If you had been modelling a one-to-many relationship, it would be more appropriate:

    CREATE TABLE authors
    ( author_id  NUMBER        PRIMARY KEY
    , last_name  VARCHAR2(200) NOT NULL
    , first_name VARCHAR2(200) NOT NULL
    );
    
    CREATE TABLE books
    ( book_id NUMBER        PRIMARY KEY
    , title   VARCHAR2(200)
    );
    
    CREATE TABLE authors_of_books
    ( author_id NUMBER NOT NULL REFERENCES authors(author_id)
    , book_id   NUMBER NOT NULL PRIMARY KEY REFERENCES books(book_id)
    );
    

    This models your one-to-many relationship with a "join" table or "bridge." The drawing above gives you the ability to change the author freely or to book the title attributes in the same place increases your data integrity.

    However, a many-to-many relationship may be more appropriate since multiple authors can write a book. So you would change the tables authors_of_books as follows:

    CREATE TABLE authors_of_books
    ( author_id NUMBER NOT NULL REFERENCES authors(author_id)
    , book_id   NUMBER NOT NULL REFERENCES books(book_id)
    , CONSTRAINT authors_of_books_pk PRIMARY KEY (author_id, book_id)
    );
    

    I hope this helps!

  • How I find myself with as many vmdk files (which are almost 320KO)?

    I'm new at this; Please, be gentle .

    I made a new Win 7-64 company VM Workstation 8.0.5. I asked a 60 GB of virtual disk in place with several files, and I found myself with 64 vmdk files (49 of which are 320 KB).

    I did the same thing a few months (on an earlier version of workstation) and 60 GB of virtual disk includes only 10 files vmdk, ranging from 1 GB and GB 28.

    Why the new VM do not end with as many files vmdk more and so much smaller?

    Thank you

    David

    David, although this was not really necessary, because I had already explained the plausible scenarios thanks nonetheless for the supply of the parsed data (factual) hard.  The reason why you have 64 files in the same directory hard is because the virtual machine has a 60 GB twoGbMaxExtentSparse virtual disk with a snapshot, and it is 32 hard files (for each) x 2 for a total of 64 records hard.  There is absolutely nothing wrong with this and is a scenario quite normal and expected and because it is so absolutely no sense why whatever mfelker made such a statement absurd as, "it's simply imposible t have 64 hard files in the same directory." and you can certainly security ignore this!

  • How to display a many-to-many relationship?

    Hello
    I wonder how would you present the master-detail-data of an n: m-relationship in the ADF?

    Suppose we have a table x and a y in the table, the xy table is our cross refrence table.

    I know that you could represent the realtionship via associations and display links, it is not clear to me how to display the detail data but I don't want to show the features of the cross-reference-table (xy).
    Instead, the data in the table there should be presented as details of table x.

    I hope you understand what I'm shooting.

    Thanks in advance.

    This can help you
    http://mjabr.WordPress.com/2011/05/21/how-to-implement-many-to-many-Association/

  • How to handle many-to-many relationship

    Hello friends,
    I'm confused, how do many many relationships in my application:

    I have agents and projects of two tables.
    Each agent can manage several projects.
    Each project can be handled by several agents.

    Example of table INIT_PROJECT:
    ID , PROJECT
    1  , X Tower
    2  , Y Tower
    3  , Z Tower
    Example of table INIT_AGEN:
    ID , Agent
    1  , A
    2  , B
    3  , C
    What is the correct way to join or to represent the relationship between the two tables to get a table that servers as a lookup table also:

    is - it to be like this:

    Example 1 in new_table
    Project_ID , Project_name, handled_by1, handled_by2, handled_by3, handled_by4
    1             , X tower        ,  A              , B
    or is it:
    ID            , Project_name, handled_by
    1             , X tower        ,  A            
    2             , X tower        ,  B              
    3             , X tower        ,  C   
    4             , Y tower        ,  A              
    5             , Y tower        ,  B              
    ........
    .....             
               
      
    Then, on a FORM I have lists of values.
    Projects and Agents.
    When the user selects a project, he or she can only see the agents engaged in this project in the list of Agents of values.
    I use a shuttle box for inserting the values "managed by".

    Or do like this:
    Example 2 of new_table
    ID , PROJECT,...,HANDLED_BY
    1  , X Tower,... ,A:B:C:D
    2  , Y Tower,... ,A:F:G:I
    3  , Z Tower,... ,F:A:I:W
    I have two lists of values:
    'Project name' and 'Agent '.
    When the user selects a project, then he must see only the values of the handled_by that are associated with this project only.

    I used this query to prepare the values in the list of officers of the value
    SELECT  
      distinct REGEXP_SUBSTR(handled_by, '[^:]+', 1, LEVEL)  d , REGEXP_SUBSTR(handled_by, '[^:]+', 1, LEVEL) r
       
      FROM  (
             SELECT   project, ROWNUM AS id
             ,      handled_by
             FROM   projects 
            ) where project = :P8_project
      CONNECT BY INSTR(handled_by, ':', 1, LEVEL-1) > 0
             AND id = PRIOR id
             AND PRIOR DBMS_RANDOM.VALUE IS NOT NULL; 
    Can you please advice what is the right way?

    Best regards
    Fateh

    Somone was asked once to use the relation tables in that many many cases and I used it since with no problems until now.

    To apply in your case, I therefore project table, agent and a relationship table call PROJECT_AGENT_R which has

    (1) project
    (2) Agent_ID

    The primary key for each table as a foreign key.

    You can update the relationship via process page in your table when after you have created a project for an agent.

    Do not use string concatenated as your code above as it can be annoying and not really a good practice.

  • Apple ID associated with too many credit cards

    Apple ID associated with too many credit cards

    This can be useful:

    Change or remove your information from payment of Apple ID - Apple Support

  • Signature on a router encrypted on a Windows XP Edition network.with family business, access encryption code is I can't get Windows to accept a code with so many characters and length 55 numbers

    Original title: signature on a router encrypted with Windows XP Home Edition

    I have a Toshiba laptop with Windows XP Home Edition. I am trying to connect wireless to a Cisco router on a corporate network. Encryption access code is length 55 numbers and I can not get Windows to accept a code with so many characters that I can on the router. Is this because I use Windows Home version? Y at - it an upgrade that will help you? Will I be more successful if I update to Windows XP Professional?

    Hello

    You should contact the support staff of assistance companies.

    You can also try to post this topic on the TechNet forums: http://social.technet.microsoft.com/Forums/en-US/category/windowsxpitpro

  • Adobe Digital Editions will not activate with too many activation error

    Adobe Digital Editions will not be activated with too many activation error.  Technical support refused to help.  What can I do?

    To reset the client contact activation support cat https://helpx.adobe.com/contact.html?step=ADE_adobe-id-signing-in_stillNeedHelp and ask for the reset of the adobe ID.

Maybe you are looking for