How to migrate from two tables

Hello

I have three tables.
Issue table 1)
QID text
1. What is the capital of the India?
2 who is our PM?

(2) table answer
response to help qid
1 1 Chennai
2 1 Delhi
3 1 Bangulore
4 2 kamal Singh
5 2 Sonia
6 2 Manmohan Singh

(3) table c
question A B C qid
1. What is the capital of the India? Bangulore of Delhi from Chennai
2 who is our PM? Kamal Singh Sonia Manmohan Singh

Please tell me how to insert data from the first two tables in the third table by using a procedure?
I tried, I get answers in the columns...

Thank you
SAI

Look at this post.

(1) I used row_number to retrieve the columns, for which the data are intended
(2) I used the PIVOT to convert data into columns.

Re: How to migrate two tables

Tags: Database

Similar Questions

  • How to migrate from Windows XP to Windows 7 non-destructively?

    How to migrate from Windows XP to Windows 7 to non-destructively?... meaning is there a way to do this without backup data (on the XP disk), the Windows 7 upgrade and then restore the XP backup data?

    Moreover, since the structures of folders (I am told are slightly different) XP and Windows 7 where can I restore the data from?

    for example where my Documents from XP to go on the side of Windows 7? and so on... there at - it a 'table of equivalence' for this?

    Thank you.

    The upgrade to Windows XP?

    Please read these instructions carefully and completely before you begin installing Windows 7: there are important steps that you must follow to upgrade your PC from Windows XP to Windows 7 in order to preserve your files and settings.

    Before you begin, you'll need to backup all your data to an external storage device, and you will need all the installation discs for the programs that you want to keep. Please make sure that you have an external hard drive (see details below).

    More detailed instructions are available at windows.microsoft.com/upgrade-windows-xp. Here are the basic steps.

    1. start Windows Upgrade Advisor (windows.microsoft.com/upgradeadvisor) to see if there are known issues that may affect the installation and the question of whether you should install the version of 32 or 64 bit Windows 7.

    2 back up your files and settings on an external hard drive using Windows Easy Transfer (windows.microsoft.com/windows-easy-transfer). If you do not have an external hard drive, you will not be able to use Windows Easy Transfer. Alternatively, you can copy the files you want to keep on a USB stick, CD or DVD.

    3. you will need to manually reinstall your programs, such as Microsoft Office, after I installed Windows 7. Gather the installation for your programs and all partner/license product key discs. You may be able to download programs from the Internet. For example, Windows Live Messenger can be installed from the download.live.com/messenger.

    4. Insert the Windows 7 DVD in your PC. When asked "which type of installation you want. Click on "Custom (advanced)."

    5. when Windows 7 is installed, use Windows Easy Transfer to restore your files and settings.

    If you are not comfortable Windows 7 installation, check with a local retail or the services of the PC company store to see if they offer upgrade services.

    http://www.notebooks.com/2009/10/13/WinXP-to-Win7/

  • Extraction of data from two tables without discounting

    Hi friends,

    I have a problem I want to extract data from two tables without discount in the text field when I will enter any value in a text field, then the value of corressponding must come to textfield corressponding.

    for example. There are two table A and B.
    Table A has Colunm

    S_ID number;
    C_ID Varchar2 (30);
    VARCHAR2 (4) s;

    Second table B Colunm name

    S_ID number;
    What varchar (30);
    L_Name varchar (20);

    When I enter in a text field then the c_id 101 s_id, dry, first_name and last_name should come to corressponding text without refresh fields.

    How can I do that.

    Thank you
    Maury

    You can use Ajax and there are tons of good examples out there for this purpose;
    For example [http://apex.oracle.com/pls/otn/f?p=31517:236:1876567353842241]

  • How to migrate from jinitiator to sun jre

    Hello

    How to migrate from the initiator to the Sun re.
    My version of the Application of the BS is 11.5.10.2 with Oracle Linux 5.6 9.2.0.5 database version (32-bit, x), installation of single node.
    Access to the client for Windows 7 (64-bit) FORM.

    Thank you.

    user11952526 wrote:
    Hello

    Oracle E-Business Suite version 11.5.10.2 (11.5.10 CU2): what is average by CU2 ?

    Thank you.

    I'm sorry for the delay, I just saw this update on time
    Please see this
    11.5.10 oracle eBusiness Suite consolidated update 2 (CU2) [ID 316366.1]

    ;) AppsMasti :)
    sharing is caring

  • How to match columns from two tables with

    Hello:
    I have two tables as below:

    Table1::(Base Table)
    Country | Prefix | Prefix_Length
    Travel | 001 | 3
    CountryB. 0012 | 4
    PaysC | 00443 | 5
    CountryD | 0091 | 4

    :(Detail Table) table2
    The population | Area | Prefix
    500 | AreaA | 0015921
    1000 | AreaB | 00122
    400. AreaC. 00443743
    300. ALIS | 0091333
    100. AreaA | 001

    I need to match these two tables with prefix columns (whose length is not fixed in the two tables: but it starts with 00 in the two tables). Two different countries the prefix may be similar up to a certain length. Thus, Prefix_Length can be used to determine (exactly) how much time should be taken in the search of Table2.

    Output:
    Country | Prefix | Area | Population
    Travel | 001 | AreaA | 600
    CountryB. 0012 | AreaB | 1000
    PaysC | 00443 | AreaC. 400
    CountryD | 0091 | ALIS | 300

    Please help me with your valuable comments.

    -Tender

    Try this

    with base_table as (
                        select 'CountryA' country,'001' prefix,3 prefix_length from dual union all
                        select 'CountryB','0012',4 from dual union all
                        select 'CountryC','00443',5 from dual union all
                        select 'CountryD','0091',4 from dual
                       ),
       detail_table as (
                        select 10 no_of_call,'0015921' prefix from dual union all
                        select 3,'00122' from dual union all
                        select 50,'00443743' from dual union all
                      select 50,'00443643' from dual union all
                        select 300,'0091333' from dual union all
                        select 60,'001' from dual
                       ) 
    
    SELECT  country,
            prefix,sum(no_of_call)
       FROM (
             select  country,
            b.prefix,no_of_call,
            decode(no_of_call,lead(no_of_call,1,0) over(partition by no_of_call order by b.prefix,no_of_call),'y','n') y_or_no
      from  base_table b,
            detail_table d
      where b.prefix = substr(d.prefix,1,prefix_length))
      where y_or_no !='y'
      group by  country,
            prefix
      order by country,
            prefix;
    

    Published by: Vi on 20 February 2012 01:07

  • delete rows from two tables

    Hello

    My main table is:

    create table CvProperties(
    cv_id number(14) primary key,
    user_id number(14) constraint Cv_fk1 references users(user_id),
    cat_id number(14) constraint Cv_fk2 references CvCategories(cat_id),
    employerOrAgent_id number(14) constraint Cv_fk3 references employerOrAgent(employerOrAgent_id),
    staff_id number(14) constraint Cv_fk4 references staff(staff_id),
    cvDate timestamp(0) default sysdate,
    cvName varchar2(230),
    status number(3),
    prev_cvId number(14),
    isEdited number(2),
    cvSource number(2) /**website, employer, agent, staff**/
    );
    

    Detail table is:

    create table cvDetails(
    cd_id number(14) primary key,
    cv_id number(14) constraint education_fk references CvProperties(cv_id),
    nationality varchar2(230),
    objectives varchar2(3900),
    name varchar2(230),
    fatherName varchar2(230),
    motherName varchar2(230),
    dob varchar2(230).
    gender varchar2(230),
    mStatus varchar2(230),
    passportNo varchar2(110),
    email varchar2(230),
    phone varchar2(45),
    mobile varchar2(25),
    address varchar2(2500),
    state varchar2(230),
    zipCode varchar2(230),
    city varchar2(230),
    education clob,
    experience clob,
    skills clob,
    languages varchar2(1400),
    hobbies varchar2(3200),
    achievements varchar2(3900),
    references varchar2(3900));
    

    I'm trying to delete the cvs that have no email + mobile + phone:

    select COUNT(*) from cvDetails where email is NULL AND mobile IS NULL AND phone IS NULL;
    

    This query shows 4814 CVs.

    How can I run that check if the e-mail, phone mobile, is null then remove cv of the two tables in query?

    Please notify

    https://www.Google.com/webhp?hl=en&tab=WW#hl=en&q=Oracle+on+delete+cascade

  • How less INT from another table

    Hello

    How could I go to try at least an intiger of two tables?

    for example:

    1 event has an availability of 100 seats.

    1 user can complete 1 transaction (1 sheet) but select several places to book through this 1 transaction.

    The event would then 98 seats available.

    Untitled-1.png

    It would be better to display through php, or it is set to a field in the event table (for example, current_availability)?

    PS do not know if this makes sense.

    So seats_amount of booking could be 1, 2, or more, depending on the number of reserved seats. With SQL, you can get the sum of the seats_amount like this: SELECT SUM (seats_amount) FROM booking WHERE the... You might return the number of original_availability and the sum of reservation in the same query if you use a LEFT JOIN to the reservation. (A left join is necessary because if nobody has yet booked, there was no result returned by reservation).

    Then I'd do the comparison in PHP to see if there are places available, taking into account the number of places required by the current transaction.

  • SELECT from two tables

    Hello, I have a problem writing to a specific SELECT statement and I hope you can help me.

    I have two tables:

    Customer:

    -Integer ID (PK)
    -Name_SecondName varchar (20)
    -Char sex
    -Full scale

    Investments:

    -Integer ID (PK)
    -Whole amount
    -Interest Numeric (3.2)
    -Client_ID (FK)


    My job is to display a number of men and a few women who have at least a $ 1000 investment. I'll jump to add data to the table, my point is simply to find a correct interpretation of the SQL query. Right now I have this:

    SELECT COUNT (DISTINCT Client_ID), COUNT (DISTINCT Client_ID)
    SOME customers JOIN investments
    WE Clients.ID = Investments.Client_ID
    WHERE amount > 1000;

    Of course, it displays twice the number of clients thanks to an investment of more than $ 1000. But how do I specify that the first indictment counts men (sex = am') and second - women (sex = 'F')? Can someone help me?

    Published by: 934019 2012-05-13 12:10

    Hello

    Here's a way to do

    SELECT       COUNT (DISTINCT CASE WHEN c.gender = 'M' THEN c.client_id END)     AS men
    ,       COUNT (DISTINCT CASE WHEN c.gender = 'F' THEN c.client_id END)     AS women
    FROM       clients       c
    JOIN       investments       i  ON       c.client_id  = i.client_id
    WHERE       i.amount       >= 1000
    ;
    

    This query will work in Oracle 8.1 or more.
    Since you have Oracle 11, you can also use the SELECT... Function pivot, but in this case, it's more complicated. That's because what to CHOOSE... PIVOT includes automatically by each column that is not involved in the pivot. (In this case, this means that all except sex and client_id columns.) Often, you do sort of a subquery to get the dynamic no cross data, so it is easy to include only the relevant columns. In this case, however, you need not any kind of subquery, so you should add a fair to exclude the additional columns if you want to use SELECT... PIVOT.

    As you say in your original post, this account of customers who have any single investment of 1000 or more. In your last post, you posted a query that looks for investments of more than 15,000. You can change the WHERE clause to say

    WHERE       i.amount       >  15000
    

    but which would produce 0 men and 0 women, given that all of the amounts in the sample data are 10000.

    934019 wrote:
    Is it possible to display the entire word 'Genre' and not only "G"?

    Sure.

    SQL * automatically sizes string columns to their maximum size. Since between the sexes are defined as CHAR (1), its maximum size is 1 character, then SQL * Plus allocates only 1 space for her, truncate the heading after 1 character. You can explicitly set the width on anything it is large enough to show the entire title, like this:

    COLUMN  gender  FORMAT  A6
    

    Include this command before you run the query. Then, SQL * Plus uses 6 places to display the sex, so there will be place for all 6 characters in the heading.

  • Find unmatched columns from two tables

    Hello guys,.

    I am trying to compare two tables based on a key of the indexed columns.

    Here is an example of what I'm trying to achieve:

    Table A: A_ID A_Name A_Income A_housecount
    Jess 11 9 2
    Rauny 4 6 22

    Table b: B_ID B_Income B_housecount
    11-5-2
    22 6 4
    In the example above data columns A_ID and B_Id are same in both tables. I'm trying to compare A_Income with B_Income & & A_housecount with B_housecount. The results of this series of samples would be:

    11-9-2
    11-5-2

    as income in the same id is different.

    As I have large amount of data in the two tables can you please give me some ideas on how I can get my results? Let me know if the explanation is not clear for you.

    Thanks in advance
    select hshold_id,hsold_income,hshold_size,
           'abc.' || case count(src1) when 0 then 'demo' else 'hshold' end the_source
      from (select hshold_id,hsold_income,hshold_size,
                   1 src1,
                   to_number(null) src2
              from abc.hshold
            union all
            select hshold_id,hsold_income,hshold_size,
                   to_number(null) src1,
                   2 src2
              from abc.demo
           )
     group by hshold_id,hsold_income,hshold_size
     having count(src1) != count(src2)
    

    Concerning

    Etbin

    Edited by: Etbin on 11.2.2011 18:00
    correction of alignment

  • Display data from two tables based on date criteria

    Hi all

    I have two tables, using these two tables and a few conditions I want to recover under result. Oracle version is (Oracle9i Enterprise Edition Release 9.2.0.8.0 - 64 bit Production)
    LOGON_ID        USER_ID       LOGON_TIME                 LOGON_TYPE    SUBSCRIBER_NO               CUSTOMER_ID
    
    26063548     4528890298   4/5/2010 12:03:58 AM            MSISDN       GSM04528890298              581751708
    logon_histories_r table records the information of each user who connects to the system. Subscriber Details table contains all the information corresponding to subscriber_no, only 1 row should be returned.
    I'm confused usage date condition for the table of the Subscriber, the input parameter date 04/04/2006 to 15/04/06

    Select lh.logon_id, lh.user_id, lh.logon_time, lh.logon_type, subs.subscriber_no, subs.customer_id
    of logon_histories_r lh, subscribed subs
    where lh.logon_time > = to_date('05-04-2010','dd-mm-yyyy')--to_date('04-04-2006','dd-mm-yyyy')
    and lh.logon_time < to_date('06-04-2010','dd-mm-yyyy')--to_date('15-01-2007','dd-mm-yyyy')
    and lh.user_id = substr (subs.subscriber_no,-10);

    If the date range is 04/05/2010 to 04/06/2010 then the data related to the BAN 581751708 must be the result,
    If the date range is 04/04/2006 to 15/01/2007 data related to the BAN 502499502 must be the result.

    Please find DDL and data relevant to these results. There are millions of records of Subscriber & logon_histories_r table, I am given appropriate providing a subscriber_id.

    CREATE TABLE LOGON_HISTORIES_R
    (
      LOGON_ID       NUMBER(12)                     NOT NULL,
      USER_ID        VARCHAR2(15 BYTE)              NOT NULL,
      LOGON_TIME     DATE                           NOT NULL,
      LOGOUT_TIME    DATE,
      LOGOUT_METHOD  VARCHAR2(15 BYTE),
      LOGON_TYPE     VARCHAR2(15 BYTE)              DEFAULT 'MSISDN'
    );
    
    CREATE TABLE SUBSCRIBER
    (
      SUBSCRIBER_NO           VARCHAR2(20 BYTE)     NOT NULL,
      CUSTOMER_ID             NUMBER(9)             NOT NULL,
      SYS_CREATION_DATE       DATE                  NOT NULL,
      SYS_UPDATE_DATE         DATE,
      OPERATOR_ID             NUMBER(9),
      APPLICATION_ID          CHAR(6 BYTE),
      DL_SERVICE_CODE         CHAR(5 BYTE)          NOT NULL,
      DL_UPDATE_STAMP         NUMBER(4),
      EFFECTIVE_DATE          DATE                  NOT NULL,
      INIT_ACTIVATION_DATE    DATE                  NOT NULL,
      SUB_STATUS              CHAR(1 BYTE)          NOT NULL,
      SUB_STATUS_DATE         DATE                  NOT NULL,
      ORIGINAL_INIT_DATE      DATE                  NOT NULL,
      SUB_STATUS_LAST_ACT     CHAR(3 BYTE),
      SUB_STATUS_RSN_CODE     CHAR(4 BYTE),
      PRODUCT_TYPE            CHAR(3 BYTE),
      CUSTOMER_BAN            NUMBER(9),
      CTN_SEQ_NO              NUMBER(9),
      REQ_ST_GRACE_PERIOD     DATE,
      REQ_END_GRACE_PERIOD    DATE,
      COMMIT_START_DATE       DATE,
      COMMIT_END_DATE         DATE,
      COMMIT_REASON_CODE      CHAR(3 BYTE),
      COMMIT_ORIG_NO_MONTH    NUMBER(3),
      SUSP_RC_RATE_TYPE       CHAR(1 BYTE),
      CONTRACT_NO             VARCHAR2(10 BYTE),
      CNT_SEQ_NO              NUMBER(9),
      DEALER_CODE             CHAR(5 BYTE),
      ORG_DEALER_CODE         CHAR(5 BYTE),
      SALES_AGENT             CHAR(5 BYTE),
      ORG_SALES_AGENT         CHAR(5 BYTE),
      REQ_DEPOSIT_AMT         NUMBER(13,2),
      LEADING_NUMBER          VARCHAR2(20 BYTE),
      PABX_IND                CHAR(1 BYTE),
      NEXT_CTN                VARCHAR2(20 BYTE),
      NEXT_CTN_CHG_DATE       DATE,
      PRV_CTN                 VARCHAR2(20 BYTE),
      PRV_CTN_CHG_DATE        DATE,
      NEXT_BAN                NUMBER(9),
      NEXT_BAN_MOVE_DATE      DATE,
      PRV_BAN                 NUMBER(9),
      PRV_BAN_MOVE_DATE       DATE,
      SUB_STS_ISSUE_DATE      DATE,
      ACTIVATE_WAIVE_RSN      CHAR(6 BYTE),
      EARLIEST_ACTV_DATE      DATE,
      SUB_ACTV_LOCATION       CHAR(4 BYTE),
      CUST_WATCH_LMT          NUMBER(11,2),
      CUST_WATCH_DATE         DATE,
      BASIC_WATCH_LMT         NUMBER(11,2),
      CREDIT_WATCH_PIN_CD     NUMBER(4),
      SUB_MARKET_CODE         CHAR(3 BYTE)          NOT NULL,
      LIMIT_RESERVED_DAYS     NUMBER(4),
      FF_EXPIRATION_DATE      DATE,
      FLEX_IND                CHAR(1 BYTE),
      DUO_IND                 CHAR(1 BYTE),
      LISTED_IND              CHAR(1 BYTE),
      SUB_DEPARTMENT_CD       CHAR(4 BYTE),
      LAST_SUBS_DISC_DT       DATE,
      LAST_SUBS_DISC_DT_UD    DATE,
      LAST_SUBSCR_DISC_SN     NUMBER(3),
      LAST_SUBSCR_DISC_SN_UD  NUMBER(3),
      PNI                     VARCHAR2(10 BYTE),
      RMS_REF_STORE_ID        CHAR(4 BYTE),
      RMS_REF_TYPE            CHAR(1 BYTE),
      RMS_REF_OD              NUMBER(9),
      DLR_ACT_FEE             NUMBER(11,2),
      PREP_AMOUNT             NUMBER(11,2),
      SUBSCRIBER_ID           NUMBER(9)             NOT NULL,
      SUB_LANG                CHAR(2 BYTE),
      SMS_RCV_STYLE_CODE      CHAR(2 BYTE),
      CONV_RUN_NO             NUMBER(3),
      ALLOW_ADVERTISING_IND   CHAR(1 BYTE),
      IVR_WRONG_ACCESS_NO     NUMBER(2),
      THRESHOLD_AMT           NUMBER(11,2),
      PUBLISH_LEVEL           CHAR(30 BYTE),
      AUTO_RELEASE_IND        CHAR(1 BYTE),
      CUST_WATCH_EFF_DATE     DATE,
      CUST_WATCH_EXP_DATE     DATE,
      OPERATOR_CW_LMT         NUMBER(11,2),
      SEND_SMS_FOR_MATCH      CHAR(1 BYTE),
      CPS_STATUS              CHAR(1 BYTE),
      CPS_TRANSACTION         NUMBER(3),
      CPS_TYPE                NUMBER(3),
      ISP_PASS                VARCHAR2(30 BYTE),
      ISP_TYPE                CHAR(2 BYTE),
      OPERATOR_TMP_DATE       DATE,
      OPERATOR_TMP_LMT        NUMBER(11,2),
      SUB_ORG_CD              CHAR(10 BYTE),
      ORG_MEMBER_NO           VARCHAR2(20 BYTE)
    );
    
    Insert into LOGON_HISTORIES_R
       (LOGON_ID, USER_ID, LOGON_TIME, LOGOUT_TIME, LOGOUT_METHOD, LOGON_TYPE)
     Values
       (26063548, '4528890298', TO_DATE('04/05/2010 00:03:58', 'MM/DD/YYYY HH24:MI:SS'), TO_DATE('04/05/2010 00:06:58', 'MM/DD/YYYY HH24:MI:SS'),  NULL, 
        'MSISDN');
    
    Insert into logon_histories_r
       (LOGON_ID, USER_ID, LOGON_TIME, LOGOUT_TIME, LOGOUT_METHOD, LOGON_TYPE)
     Values
       (2649592, '4528890298', TO_DATE('04/10/2006 19:19:20', 'MM/DD/YYYY HH24:MI:SS'), TO_DATE('04/10/2006 19:19:48', 'MM/DD/YYYY HH24:MI:SS'), 'TIMEOUT', 
        'MSISDN');
    
    
    
    Insert into SUBSCRIBER
       (SUBSCRIBER_NO, CUSTOMER_ID, SYS_CREATION_DATE, SYS_UPDATE_DATE, OPERATOR_ID, APPLICATION_ID, DL_SERVICE_CODE, DL_UPDATE_STAMP, EFFECTIVE_DATE, INIT_ACTIVATION_DATE, SUB_STATUS, SUB_STATUS_DATE, ORIGINAL_INIT_DATE, SUB_STATUS_LAST_ACT, SUB_STATUS_RSN_CODE, PRODUCT_TYPE, CUSTOMER_BAN, CTN_SEQ_NO, REQ_ST_GRACE_PERIOD, REQ_END_GRACE_PERIOD, COMMIT_START_DATE, COMMIT_END_DATE, COMMIT_REASON_CODE, COMMIT_ORIG_NO_MONTH, SUSP_RC_RATE_TYPE, CONTRACT_NO, CNT_SEQ_NO, DEALER_CODE, ORG_DEALER_CODE, SALES_AGENT, ORG_SALES_AGENT, REQ_DEPOSIT_AMT, LEADING_NUMBER, PABX_IND, NEXT_CTN, NEXT_CTN_CHG_DATE, PRV_CTN, PRV_CTN_CHG_DATE, NEXT_BAN, NEXT_BAN_MOVE_DATE, PRV_BAN, PRV_BAN_MOVE_DATE, SUB_STS_ISSUE_DATE, ACTIVATE_WAIVE_RSN, EARLIEST_ACTV_DATE, SUB_ACTV_LOCATION, CUST_WATCH_LMT, CUST_WATCH_DATE, BASIC_WATCH_LMT, CREDIT_WATCH_PIN_CD, SUB_MARKET_CODE, LIMIT_RESERVED_DAYS, FF_EXPIRATION_DATE, FLEX_IND, DUO_IND, LISTED_IND, SUB_DEPARTMENT_CD, LAST_SUBS_DISC_DT, LAST_SUBS_DISC_DT_UD, LAST_SUBSCR_DISC_SN, LAST_SUBSCR_DISC_SN_UD, PNI, RMS_REF_STORE_ID, RMS_REF_TYPE, RMS_REF_OD, DLR_ACT_FEE, PREP_AMOUNT, SUBSCRIBER_ID, SUB_LANG, SMS_RCV_STYLE_CODE, CONV_RUN_NO, ALLOW_ADVERTISING_IND, IVR_WRONG_ACCESS_NO, THRESHOLD_AMT, PUBLISH_LEVEL, AUTO_RELEASE_IND, CUST_WATCH_EFF_DATE, CUST_WATCH_EXP_DATE, OPERATOR_CW_LMT, SEND_SMS_FOR_MATCH, CPS_STATUS, CPS_TRANSACTION, CPS_TYPE, ISP_PASS, ISP_TYPE, OPERATOR_TMP_DATE, OPERATOR_TMP_LMT, SUB_ORG_CD, ORG_MEMBER_NO)
     Values
       ('GSM04528890298', 110069191, TO_DATE('12/04/2001 17:06:17', 'MM/DD/YYYY HH24:MI:SS'), TO_DATE('01/01/2004 22:42:49', 'MM/DD/YYYY HH24:MI:SS'), NULL, 
        'FUTRX ', 'CS016', NULL, TO_DATE('01/02/2004 00:08:32', 'MM/DD/YYYY HH24:MI:SS'), TO_DATE('07/31/2000 00:00:00', 'MM/DD/YYYY HH24:MI:SS'), 
        'C', TO_DATE('01/02/2004 00:00:00', 'MM/DD/YYYY HH24:MI:SS'), TO_DATE('07/31/2000 00:00:00', 'MM/DD/YYYY HH24:MI:SS'), 'CAN', 'CNP3', 
        'GSM', 110069191, 7013986, NULL, NULL, 
        TO_DATE('07/31/2000 00:00:00', 'MM/DD/YYYY HH24:MI:SS'), TO_DATE('01/31/2001 00:00:00', 'MM/DD/YYYY HH24:MI:SS'), 'PPD', 6, NULL, 
        NULL, 1008631, 'DCNV ', 'DCNV ', 'DFLT ', 
        'DFLT ', 0, NULL, 'S', NULL, 
        NULL, NULL, NULL, NULL, NULL, 
        NULL, NULL, TO_DATE('01/02/2004 00:00:00', 'MM/DD/YYYY HH24:MI:SS'), NULL, TO_DATE('07/31/2000 00:00:00', 'MM/DD/YYYY HH24:MI:SS'), 
        'TEMO', 0, NULL, 0, NULL, 
        'TEL', NULL, NULL, 'N', 'N', 
        'Y', NULL, NULL, NULL, NULL, 
        NULL, NULL, NULL, NULL, NULL, 
        0, 0, 8635, 'DK', '01', 
        1, 'N', NULL, 0, '1234', 
        NULL, NULL, NULL, NULL, NULL, 
        NULL, NULL, NULL, NULL, NULL, 
        NULL, NULL, NULL, NULL);
    Insert into SUBSCRIBER
       (SUBSCRIBER_NO, CUSTOMER_ID, SYS_CREATION_DATE, SYS_UPDATE_DATE, OPERATOR_ID, APPLICATION_ID, DL_SERVICE_CODE, DL_UPDATE_STAMP, EFFECTIVE_DATE, INIT_ACTIVATION_DATE, SUB_STATUS, SUB_STATUS_DATE, ORIGINAL_INIT_DATE, SUB_STATUS_LAST_ACT, SUB_STATUS_RSN_CODE, PRODUCT_TYPE, CUSTOMER_BAN, CTN_SEQ_NO, REQ_ST_GRACE_PERIOD, REQ_END_GRACE_PERIOD, COMMIT_START_DATE, COMMIT_END_DATE, COMMIT_REASON_CODE, COMMIT_ORIG_NO_MONTH, SUSP_RC_RATE_TYPE, CONTRACT_NO, CNT_SEQ_NO, DEALER_CODE, ORG_DEALER_CODE, SALES_AGENT, ORG_SALES_AGENT, REQ_DEPOSIT_AMT, LEADING_NUMBER, PABX_IND, NEXT_CTN, NEXT_CTN_CHG_DATE, PRV_CTN, PRV_CTN_CHG_DATE, NEXT_BAN, NEXT_BAN_MOVE_DATE, PRV_BAN, PRV_BAN_MOVE_DATE, SUB_STS_ISSUE_DATE, ACTIVATE_WAIVE_RSN, EARLIEST_ACTV_DATE, SUB_ACTV_LOCATION, CUST_WATCH_LMT, CUST_WATCH_DATE, BASIC_WATCH_LMT, CREDIT_WATCH_PIN_CD, SUB_MARKET_CODE, LIMIT_RESERVED_DAYS, FF_EXPIRATION_DATE, FLEX_IND, DUO_IND, LISTED_IND, SUB_DEPARTMENT_CD, LAST_SUBS_DISC_DT, LAST_SUBS_DISC_DT_UD, LAST_SUBSCR_DISC_SN, LAST_SUBSCR_DISC_SN_UD, PNI, RMS_REF_STORE_ID, RMS_REF_TYPE, RMS_REF_OD, DLR_ACT_FEE, PREP_AMOUNT, SUBSCRIBER_ID, SUB_LANG, SMS_RCV_STYLE_CODE, CONV_RUN_NO, ALLOW_ADVERTISING_IND, IVR_WRONG_ACCESS_NO, THRESHOLD_AMT, PUBLISH_LEVEL, AUTO_RELEASE_IND, CUST_WATCH_EFF_DATE, CUST_WATCH_EXP_DATE, OPERATOR_CW_LMT, SEND_SMS_FOR_MATCH, CPS_STATUS, CPS_TRANSACTION, CPS_TYPE, ISP_PASS, ISP_TYPE, OPERATOR_TMP_DATE, OPERATOR_TMP_LMT, SUB_ORG_CD, ORG_MEMBER_NO)
     Values
       ('GSM04528890298', 502499502, TO_DATE('12/05/2006 15:55:13', 'MM/DD/YYYY HH24:MI:SS'), TO_DATE('01/12/2007 00:45:22', 'MM/DD/YYYY HH24:MI:SS'), NULL, 
        'FUTRX ', 'CS058', NULL, TO_DATE('01/12/2007 00:45:22', 'MM/DD/YYYY HH24:MI:SS'), TO_DATE('12/05/2006 00:00:00', 'MM/DD/YYYY HH24:MI:SS'), 
        'C', TO_DATE('01/12/2007 00:00:00', 'MM/DD/YYYY HH24:MI:SS'), TO_DATE('12/05/2006 00:00:00', 'MM/DD/YYYY HH24:MI:SS'), 'CCN', 'NP  ', 
        'GSM', 502499502, 14419730, NULL, NULL, 
        TO_DATE('12/05/2006 00:00:00', 'MM/DD/YYYY HH24:MI:SS'), TO_DATE('06/04/2007 00:00:00', 'MM/DD/YYYY HH24:MI:SS'), 'PPD', 6, NULL, 
        '1035393', 6976424, '2311 ', '2311 ', 'DFLT ', 
        'DFLT ', NULL, '045', 'S', 'GSM04525210338', 
        TO_DATE('01/12/2007 00:00:00', 'MM/DD/YYYY HH24:MI:SS'), NULL, NULL, NULL, NULL, 
        NULL, NULL, TO_DATE('01/12/2007 00:00:00', 'MM/DD/YYYY HH24:MI:SS'), NULL, TO_DATE('12/05/2006 00:00:00', 'MM/DD/YYYY HH24:MI:SS'), 
        'TEMO', NULL, NULL, NULL, NULL, 
        'TEL', NULL, NULL, 'N', 'N', 
        'Y', NULL, NULL, NULL, NULL, 
        NULL, NULL, NULL, NULL, NULL, 
        NULL, NULL, 6834900, 'DK', '01', 
        NULL, 'N', NULL, 9999999.99, '4321', 
        NULL, NULL, NULL, NULL, NULL, 
        NULL, NULL, NULL, NULL, NULL, 
        NULL, NULL, NULL, NULL);
    Insert into SUBSCRIBER
       (SUBSCRIBER_NO, CUSTOMER_ID, SYS_CREATION_DATE, SYS_UPDATE_DATE, OPERATOR_ID, APPLICATION_ID, DL_SERVICE_CODE, DL_UPDATE_STAMP, EFFECTIVE_DATE, INIT_ACTIVATION_DATE, SUB_STATUS, SUB_STATUS_DATE, ORIGINAL_INIT_DATE, SUB_STATUS_LAST_ACT, SUB_STATUS_RSN_CODE, PRODUCT_TYPE, CUSTOMER_BAN, CTN_SEQ_NO, REQ_ST_GRACE_PERIOD, REQ_END_GRACE_PERIOD, COMMIT_START_DATE, COMMIT_END_DATE, COMMIT_REASON_CODE, COMMIT_ORIG_NO_MONTH, SUSP_RC_RATE_TYPE, CONTRACT_NO, CNT_SEQ_NO, DEALER_CODE, ORG_DEALER_CODE, SALES_AGENT, ORG_SALES_AGENT, REQ_DEPOSIT_AMT, LEADING_NUMBER, PABX_IND, NEXT_CTN, NEXT_CTN_CHG_DATE, PRV_CTN, PRV_CTN_CHG_DATE, NEXT_BAN, NEXT_BAN_MOVE_DATE, PRV_BAN, PRV_BAN_MOVE_DATE, SUB_STS_ISSUE_DATE, ACTIVATE_WAIVE_RSN, EARLIEST_ACTV_DATE, SUB_ACTV_LOCATION, CUST_WATCH_LMT, CUST_WATCH_DATE, BASIC_WATCH_LMT, CREDIT_WATCH_PIN_CD, SUB_MARKET_CODE, LIMIT_RESERVED_DAYS, FF_EXPIRATION_DATE, FLEX_IND, DUO_IND, LISTED_IND, SUB_DEPARTMENT_CD, LAST_SUBS_DISC_DT, LAST_SUBS_DISC_DT_UD, LAST_SUBSCR_DISC_SN, LAST_SUBSCR_DISC_SN_UD, PNI, RMS_REF_STORE_ID, RMS_REF_TYPE, RMS_REF_OD, DLR_ACT_FEE, PREP_AMOUNT, SUBSCRIBER_ID, SUB_LANG, SMS_RCV_STYLE_CODE, CONV_RUN_NO, ALLOW_ADVERTISING_IND, IVR_WRONG_ACCESS_NO, THRESHOLD_AMT, PUBLISH_LEVEL, AUTO_RELEASE_IND, CUST_WATCH_EFF_DATE, CUST_WATCH_EXP_DATE, OPERATOR_CW_LMT, SEND_SMS_FOR_MATCH, CPS_STATUS, CPS_TRANSACTION, CPS_TYPE, ISP_PASS, ISP_TYPE, OPERATOR_TMP_DATE, OPERATOR_TMP_LMT, SUB_ORG_CD, ORG_MEMBER_NO)
     Values
       ('GSM04528890298', 581751708, TO_DATE('03/31/2010 19:10:33', 'MM/DD/YYYY HH24:MI:SS'), TO_DATE('04/01/2010 16:17:40', 'MM/DD/YYYY HH24:MI:SS'), 10077, 
        NULL, 'CS009', NULL, TO_DATE('03/31/2010 19:10:33', 'MM/DD/YYYY HH24:MI:SS'), TO_DATE('03/31/2010 00:00:00', 'MM/DD/YYYY HH24:MI:SS'), 
        'A', TO_DATE('03/31/2010 00:00:00', 'MM/DD/YYYY HH24:MI:SS'), TO_DATE('03/31/2010 00:00:00', 'MM/DD/YYYY HH24:MI:SS'), 'NAC', 'CA  ', 
        'GSM', 581751708, 24798333, NULL, NULL, 
        TO_DATE('03/31/2010 00:00:00', 'MM/DD/YYYY HH24:MI:SS'), TO_DATE('09/29/2010 00:00:00', 'MM/DD/YYYY HH24:MI:SS'), NULL, 6, NULL, 
        NULL, 12093584, '2357 ', '2357 ', 'DFLT ', 
        'DFLT ', NULL, '045', 'S', NULL, 
        NULL, NULL, NULL, NULL, NULL, 
        NULL, NULL, TO_DATE('03/31/2010 00:00:00', 'MM/DD/YYYY HH24:MI:SS'), NULL, TO_DATE('03/31/2010 00:00:00', 'MM/DD/YYYY HH24:MI:SS'), 
        'TEMO', NULL, NULL, NULL, NULL, 
        'TEL', NULL, TO_DATE('12/31/4700 00:00:00', 'MM/DD/YYYY HH24:MI:SS'), 'N', 'N', 
        'Y', NULL, NULL, NULL, NULL, 
        NULL, NULL, NULL, NULL, NULL, 
        NULL, NULL, 9474437, 'DK', '01', 
        NULL, 'N', NULL, 999999999.99, '12', 
        NULL, NULL, NULL, NULL, NULL, 
        NULL, NULL, NULL, NULL, NULL, 
        NULL, NULL, NULL, NULL);
    Insert into SUBSCRIBER
       (SUBSCRIBER_NO, CUSTOMER_ID, SYS_CREATION_DATE, SYS_UPDATE_DATE, OPERATOR_ID, APPLICATION_ID, DL_SERVICE_CODE, DL_UPDATE_STAMP, EFFECTIVE_DATE, INIT_ACTIVATION_DATE, SUB_STATUS, SUB_STATUS_DATE, ORIGINAL_INIT_DATE, SUB_STATUS_LAST_ACT, SUB_STATUS_RSN_CODE, PRODUCT_TYPE, CUSTOMER_BAN, CTN_SEQ_NO, REQ_ST_GRACE_PERIOD, REQ_END_GRACE_PERIOD, COMMIT_START_DATE, COMMIT_END_DATE, COMMIT_REASON_CODE, COMMIT_ORIG_NO_MONTH, SUSP_RC_RATE_TYPE, CONTRACT_NO, CNT_SEQ_NO, DEALER_CODE, ORG_DEALER_CODE, SALES_AGENT, ORG_SALES_AGENT, REQ_DEPOSIT_AMT, LEADING_NUMBER, PABX_IND, NEXT_CTN, NEXT_CTN_CHG_DATE, PRV_CTN, PRV_CTN_CHG_DATE, NEXT_BAN, NEXT_BAN_MOVE_DATE, PRV_BAN, PRV_BAN_MOVE_DATE, SUB_STS_ISSUE_DATE, ACTIVATE_WAIVE_RSN, EARLIEST_ACTV_DATE, SUB_ACTV_LOCATION, CUST_WATCH_LMT, CUST_WATCH_DATE, BASIC_WATCH_LMT, CREDIT_WATCH_PIN_CD, SUB_MARKET_CODE, LIMIT_RESERVED_DAYS, FF_EXPIRATION_DATE, FLEX_IND, DUO_IND, LISTED_IND, SUB_DEPARTMENT_CD, LAST_SUBS_DISC_DT, LAST_SUBS_DISC_DT_UD, LAST_SUBSCR_DISC_SN, LAST_SUBSCR_DISC_SN_UD, PNI, RMS_REF_STORE_ID, RMS_REF_TYPE, RMS_REF_OD, DLR_ACT_FEE, PREP_AMOUNT, SUBSCRIBER_ID, SUB_LANG, SMS_RCV_STYLE_CODE, CONV_RUN_NO, ALLOW_ADVERTISING_IND, IVR_WRONG_ACCESS_NO, THRESHOLD_AMT, PUBLISH_LEVEL, AUTO_RELEASE_IND, CUST_WATCH_EFF_DATE, CUST_WATCH_EXP_DATE, OPERATOR_CW_LMT, SEND_SMS_FOR_MATCH, CPS_STATUS, CPS_TRANSACTION, CPS_TYPE, ISP_PASS, ISP_TYPE, OPERATOR_TMP_DATE, OPERATOR_TMP_LMT, SUB_ORG_CD, ORG_MEMBER_NO)
     Values
       ('GSM04528890298', 816370100, TO_DATE('09/03/2005 10:12:13', 'MM/DD/YYYY HH24:MI:SS'), TO_DATE('03/14/2006 12:20:09', 'MM/DD/YYYY HH24:MI:SS'), 14462, 
        NULL, 'CS016', NULL, TO_DATE('03/14/2006 12:20:08', 'MM/DD/YYYY HH24:MI:SS'), TO_DATE('09/03/2005 00:00:00', 'MM/DD/YYYY HH24:MI:SS'), 
        'C', TO_DATE('03/14/2006 00:00:00', 'MM/DD/YYYY HH24:MI:SS'), TO_DATE('09/03/2005 00:00:00', 'MM/DD/YYYY HH24:MI:SS'), 'CAN', 'CNP3', 
        'GSM', 816370100, 12575966, NULL, NULL, 
        TO_DATE('09/03/2005 00:00:00', 'MM/DD/YYYY HH24:MI:SS'), TO_DATE('03/02/2006 00:00:00', 'MM/DD/YYYY HH24:MI:SS'), 'PPD', 6, NULL, 
        '690925', 3436964, '4243 ', '4243 ', 'DFLT ', 
        'DFLT ', NULL, '045', 'S', NULL, 
        NULL, NULL, NULL, NULL, NULL, 
        NULL, NULL, TO_DATE('03/14/2006 00:00:00', 'MM/DD/YYYY HH24:MI:SS'), NULL, TO_DATE('09/03/2005 00:00:00', 'MM/DD/YYYY HH24:MI:SS'), 
        'TEMO', NULL, NULL, NULL, NULL, 
        'TEL', NULL, NULL, 'N', 'N', 
        'Y', NULL, NULL, NULL, NULL, 
        NULL, NULL, NULL, NULL, NULL, 
        NULL, NULL, 1436383, 'DK', '01', 
        NULL, 'N', NULL, 9999999.99, '0', 
        NULL, NULL, NULL, NULL, NULL, 
        NULL, NULL, NULL, NULL, NULL, 
        NULL, NULL, NULL, NULL);

    Hello

    Welcome to the froum!

    Thanks for posting the CREATE TABLE and INSERT! It's very nigra.

    user12990691 wrote:
    ...
    logon_histories_r table records the information of each user who connects to the system. Subscriber Details table contains all the information corresponding to subscriber_no, only 1 row should be returned.

    Do you mean a line by the user, or a line every time that you run the report, regardless of the number of users connected during the period that interests us?
    Anyway, if there are multiple logons, how do you decide that one? Or the output of logon_histories_r columns will be a sort of composite?

    I'm confused usage date condition for the table of the Subscriber, the input parameter date 04/04/2006 to 15/04/06

    Select lh.logon_id, lh.user_id, lh.logon_time, lh.logon_type, subs.subscriber_no, subs.customer_id
    of logon_histories_r lh, subscribed subs
    where lh.logon_time > = to_date('05-04-2010','dd-mm-yyyy')--to_date('04-04-2006','dd-mm-yyyy')
    and lh.logon_time< to_date('06-04-2010','dd-mm-yyyy')="" --="">
    and lh.user_id = substr (subs.subscriber_no,-10);

    Must LH.LOGON_TIME match something in the subscruber table? If so, you need to addsome extra join pathological.
    For example, if lh.logon_time must be between d1 and d2 (where d1 and d2 are DATE columns), then:

    select      lh.logon_id
    ,     lh.user_id
    ,     lh.logon_time
    ,     lh.logon_type
    ,     subs.subscriber_no
    ,     subs.customer_id
    from      logon_histories_r      lh
    ,      subscriber           subs
    where      lh.logon_time      >= to_date ('05-04-2010','dd-mm-yyyy') -- to_date('04-04-2006','dd-mm-yyyy')
    and      lh.logon_time      <  to_date ('06-04-2010','dd-mm-yyyy') -- to_date('15-01-2007','dd-mm-yyyy')
    and      lh.user_id      = substr (subs.subscriber_no, -10)
    and     lh.logon_time     >= subs.d1     -- New condition added
    and     lh.logon_time     <= subs.d2     -- New condition added
    ;
    

    Please find DDL and data relevant to these results. There are millions of records of Subscriber & logon_histories_r table, I am given appropriate providing a subscriber_id.

    That's smart, don't not post each row of the table: looks like you posted just enough to show what the problem is.
    Try to do the same thing with the columns. Do not post every single column, just the columns that have something to do with the problem.

  • How to migrate from OSH to ADR?

    Afternoon everyone,

    I have an existing installation of OSH that is running that a number of DAD to connect to different databases, all running Apex 4.2.  I'm looking to migrate to ADR on Tomcat.

    I tested the deployment ADR on Tomcat and connecting to a new installation of 11g default XE and everything works fine, I'm comfortable with the process of functioning of the installation of the ADR itself, but I was wondering if there is a document on MOS or a similar place on how to migrate an existing install, what pitfalls to look out for , which may need to change when you use a different headset etc.

    I read a thread here that mentions things like authentication may need to change the use of the listener of ADR on OSH etc.

    As a side note, I am aware that I can convert each of these files DAD individual war deployed on Tomcat by changing the file name from war and using a different context root, or I can use the map and configure each database on a single installation of war ADR, it not a lot of documentation on this is there a recommended Oracle position on this?

    If someone is able to provide guidance or a link I would really appreciate it.

    Kind regards

    Rich

    Hi RichDBA,

    RichDBA wrote:

    I have an existing installation of OSH that is running that a number of DAD to connect to different databases, all running Apex 4.2.  I'm looking to migrate to ADR on Tomcat.

    I tested the deployment ADR on Tomcat and connecting to a new installation of 11g default XE and everything works fine, I'm comfortable with the process of functioning of the installation of the ADR itself, but I was wondering if there is a document on MOS or a similar place on how to migrate an existing install, what pitfalls to look out for , which may need to change when you use a different headset etc.

    You change the layer Web of Oracle APEX and there is nothing other than the correct configuration of the Web server with the existing installation of Oracle APEX.

    I read a thread here that mentions things like authentication may need to change the use of the listener of ADR on OSH etc.

    Then mention that the son, and how they resemble your problems of authentication scheme.

    As a side note, I am aware that I can convert each of these files DAD individual war deployed on Tomcat by changing the file name from war and using a different context root, or I can use the map and configure each database on a single installation of war ADR, it not a lot of documentation on this is there a recommended Oracle position on this?

    With ADR 2.0 (last ADR 3.0) you do not need to generate different ords.war for each configuration of DAD. In this ADR, you configure several databases and through the URL mapping feature, you can have multiple instances APEX listens to a Web server.

    Reference:

    I hope this helps!

    Kind regards

    Kiran

  • Delete rows in a table when the columns from two tables match

    Hello

    I have following two tables.

    ===========================================

    create the table empbooth as

    (

    Select 1 empid, 1 double cabin Union all the

    Select option 2, Union 1 double all the

    Select 3, Union 1 double all the

    Select option 4, Union 2 double all the

    Select option 5, 2 double

    );

    create the table attsht as

    (

    Select 1 empid, 240 reg, 0 unpaid all double union

    Select option 2, reg 200, 0 unpaid of all the double union

    Select 3, 240 reg, 0 unpaid all double them union

    Select 4 480 reg, 0 unpaid all double union

    Select 5 240 reg, unpaid double 0

    );

    =================================================

    I want to remove rows from attsht where corresponding booth (which is stored in the empbooth table) is 1.

    The condition is 'where attsht.empid = empbooth.empid and empbooth.booth = 1 '.

    I use oracle 10g.

    Help, please

    delete from attsht where a.empid in (select b.empid from empbooth b where b.booth = 1)

    or

    remove from attsht a

    where exists (select null

    of empbooth b

    where b.booth = 1

    and b.empid = a.empid)

  • Extract single line transformed from two tables

    I have two tables T1 and T2 with the same set of columns. The columns are C1, C2, C3, COND1. I need to issue a query that returns a line transformed in order to respect the following rules:

    1. the returned line may contain values from both tables based on the values of column in table T1.

    2 return the column C1 in table T1; If it is NULL, then return to any value is present in the column C1 of T2.

    3. article 2 above apply to all columns like C1, C2 etc.

    I published the following query. The problem is that if a subquery does not reach the entire query fails. Someone help me please. Probably there is another simple method.

    SELECT NVL (T1.c1, T2.c1) c1, c2 (T1.c2, T2.c2) NVL NVL (T1.c3, T2.c3) c3

    FROM (SELECT c1, c2, c3

    FROM T1

    WHERE cond1 = 'T10') T1

    (SELECT c1, c2, c3

    THE T2

    WHERE cond1 = "T200") T2;

    Hello

    user4274403 wrote:

    I have two tables T1 and T2 with the same set of columns. The columns are C1, C2, C3, COND1. I need to issue a query that returns a line transformed in order to respect the following rules:

    1. the returned line may contain values from both tables based on the values of column in table T1.

    2 return the column C1 in table T1; If it is NULL, then return to any value is present in the column C1 of T2.

    3. article 2 above apply to all columns like C1, C2 etc.

    I published the following query. The problem is that if a subquery does not reach the entire query fails. Someone help me please. Probably there is another simple method.

    SELECT NVL (T1.c1, T2.c1) c1, c2 (T1.c2, T2.c2) NVL NVL (T1.c3, T2.c3) c3

    FROM (SELECT c1, c2, c3

    FROM T1

    WHERE cond1 = 'T10') T1

    (SELECT c1, c2, c3

    THE T2

    WHERE cond1 = "T200") T2;

    Are you saying that if there is no row in t1 that satisfy the condition cond1 = "T10", then you want to keep seeing the lines (and values) of the t2?

    And even, if there is no row in t2 that satisfy the cond1 = "T200" condition, then you want to keep seeing the lines (and values) from t1?

    If so, this looks like a job for a full outer join.

    You can change the join in a full outer join as follows:

    SELECT NVL (T1.c1, T2.c1) AS c1

    , NVL (T1.c2, T2.c2) C2

    NVL (T1.c3, T2.c3) AS c3

    FROM T1

    FULL OUTER JOIN T2 ON t1.cond1 = 'T10 '.

    AND t2.cond1 = 'T200.

    WHERE t1.cond1 = 'T10 '.

    OR t2.cond1 = "T200"

    ;

    If you would care to post CREATE TABLE and INSERT instructions for some examples of data, then I could test this.

    What happens if no table has all the lines that have good values in cond1?

  • How to update these two tables

    Hello

    I have two tables (in Oracle 11 g R2) and need to lock some lines in each of them for the update...
    Here is the sample data and the result after update, please help me for update instructions.
    Thanks in advance!
    drop table t1;
    drop table t2;
    create table t1(
    t1_id     number(5) primary key,
    t1_col2   varchar2(20),
    t1_col3   varchar2(10),
    t2_id     varchar2(5));
    
    create table t2(
    t2_id    varchar2(5) primary key,
    t2_col2  varchar2(10),
    t2_col3  number(2),
    t1_id    number);
    
    insert into t1 values(1, '1 - col2', 'AB', null);
    insert into t1 values(2, '2 - col2', 'AB', null);
    insert into t1 values(3, '3 - col2', 'AB', null);
    insert into t1 values(4, '4 - col2', 'AC', null);
    insert into t1 values(5, '5 - col2', 'AC', null);
    insert into t1 values(6, '6 - col2', 'AC', null);
    insert into t1 values(7, '7 - col2', 'AC', null);
    insert into t1 values(8, '8 - col2', 'AC', null);
    insert into t1 values(9, '9 - col2', 'AC', null);
    insert into t1 values(10, '10 - col2', 'AC', null);
    commit;
    insert into t2 values('11001', 'ABC', 12, null);
    insert into t2 values('11021', 'ABC', 12, null);
    insert into t2 values('11022', 'ABC', 12, null);
    insert into t2 values('11023', 'ABC', 12, null);
    insert into t2 values('11024', 'ABC', 12, null);
    insert into t2 values('11025', 'ABC', 12, null);
    insert into t2 values('11030', 'ABC', 12, null);
    insert into t2 values('11035', 'ABC', 12, null);
    insert into t2 values('11051', 'ABC', 12, null);
    insert into t2 values('11061', 'ABC', 12, null);
    insert into t2 values('11071', 'ABC', 12, null);
    insert into t2 values('11081', 'ABC', 11, null);
    insert into t2 values('11091', 'ABC', 11, null);
    commit;
    
    
    declare
      cursor c1 is select * 
                     from t1
                    where t1_id in(select t1_id from (select t1_id from t1 where t1_col3 = 'AC' order by t1_id) where rownum <= 5)
                   for update;
    
      cursor c2 is select * 
                     from t2
                    where t2_id in(select t2_id from (select t2_id from t2 where t2_col3 = 12 order by t2_id) where rownum <= 5)
                   for update;
    begin
      for rec_c1 in c1 loop
          ???
      end loop;
    end;
    /
    
    
    The result must look like:
    
         T1_ID T1_COL2              T1_COL3    T2_ID
    ---------- -------------------- ---------- -----
             4 4 - col2             AC         11001
             5 5 - col2             AC         11021
             6 6 - col2             AC         11022
             7 7 - col2             AC         11023
             8 8 - col2             AC         11024
    
    
    T2_ID T2_COL2       T2_COL3      T1_ID
    ----- ---------- ---------- ----------
    11001 ABC                12          4
    11021 ABC                12          5          
    11022 ABC                12          6
    11023 ABC                12          7
    11024 ABC                12          8

    With the help of Bencol :-)

    DECLARE
       CURSOR c1
       IS
          SELECT a.t1_id, b.t2_id
            FROM t1 a CROSS JOIN t2 b
           WHERE (a.t1_id, b.t2_id) IN (SELECT t1.t1_id, t2.t2_id
                                          FROM    (SELECT t1_id
                                                        , ROW_NUMBER () OVER (ORDER BY t1_id) t1_rn
                                                     FROM t1
                                                    WHERE t1_col3 = 'AC') t1
                                               JOIN
                                                  (SELECT t2_id
                                                        , ROW_NUMBER () OVER (ORDER BY t1_id) t2_rn
                                                     FROM t2
                                                    WHERE t2_col3 = 12) t2
                                               ON t1.t1_rn = t2.t2_rn
                                         WHERE t1.t1_rn <= 5)
          FOR UPDATE;
    BEGIN
       FOR rec_c1 IN c1
       LOOP
          UPDATE t1
             SET t2_id = rec_c1.t2_id
           WHERE t1_id = rec_c1.t1_id;
    
          UPDATE t2
             SET t1_id = rec_c1.t1_id
           WHERE t2_id = rec_c1.t2_id;
       END LOOP;
    END;
    /
    

    Kind regards.
    Al

  • How to export diferent two tables of contents to epub?

    I have been reseraching french forum of responses to the question I have but could ' t find anything for my case. I am a book of plants convert epub. The layout that gave me was the printed version of the book, I use Indesign 5.5 to convert the epub book. For the results of the tests, I use Calibre and a Kindle.

    I was n style texts and images and everything is great except for the table of contents. The author needs to a content page with all the main chapters (h1 title) and an index at the end of the book with all the names of the plants: this has two titles an eglish followed by the Latin version (h2-h3-Latin and English).

    I've created two different styles of toc, one with only the chapter headings, would be at the table of contents at the beginning and the second style is for the index of plants: with the h2 and h3 titles (I checked the alphabetical button in both to have the section index correctly).

    I have two questions: the first is when I try to place each table of contents at the beginning and at the end of the book. On the page, it looks fine, but when I export to epub, I can choose only in the export Panel, one table of contents. The resulting epub has the same table at the beginning and at the end I tried several times to change the position of the tables, export settings, but I never managed to have two different tables on the same epub.

    The second question is when I had expoorted one of these tests using the style 2 for the index, I get an epub with the two tables of the same material, the index is in alphabetical order, but instead of ordering all the plants of a to z he ordered their "pairs" as they appear on the texts (first English title plants the latin equivalent of a second). How can I do to make this index order alphabetically all the h2 and h3? I need all the a, b, c,... indendently of their position in the page.

    Hope the above makes sense.

    Thanks in advance.

    Thanks for your offer of Ariel, I'm sure is a good script, but I can't affford it right now.

    See you soon

Maybe you are looking for

  • Apple Watch lights even if the load.

    I don't use my Apple Watch to indicate the time, when I get home from work at 3:30, it is 88%, never taken in the shower, and 07:00, it works always, usually, when I wake up at 7:00, it is 100% and runs to 49% at 23:59. Now, even if I just use it as

  • Mark a message as brands to read the entire thread as read.

    Other marking as read e-mail clients on a single message in a thread mark only this message as read. With Thunderbird, if I have three unread messages in a thread and manually mark one as 'read', the other two messages change to 'read' as well. I saw

  • Can I use USB hubs on cRIO?

    I would use the USB port on the cRIO 2 purposes. One for connecting to a USB key and another to control a small LCD 16 x 2 display. LCD screen will be updated very rarely but will give us a lot of read/write on the USB drive. I want to know if I can

  • Upgrade of RAM i7 540 how fast can the processor actually use

    I just got a 540 and I want to know how fast RAM i7 processor is able to use to my advantage. The BIOS can deal with setting parameters at a higher speed of RAM? Second question, the system tolerates 1.3V RAM?

  • Unable to start after the installation of updates

    original title: after doing a clean install of Vista Premium he had 105 updates to do, but since their doing that he has not done everything it will be now I can get into safe mode does not start, but that's all I did a clean install of Vista basic f