compare two tables

I have two paintings like these

Table 1 table 2

a 1

a      5                                 a

b      2                                 b

c      3                                 f

d      4                                 g

e      5                                 h

f 6

g 7

g 10

h 8

h 9.

with what I have now, I can create a table that lists the matching elements

Results:

a          1

b          2

f           6

g          7

h          8

However, it does not save the two sets of a, g, h, only the first instance. Someone knows how to fix this?

Any help is appreciated

A loop inside another loop FOR FOR should do the trick.  Have the index of auto outer loop on the parameters of search and index of auto inner loop on the search table.  On a match, add this element to the list.

Tags: NI Software

Similar Questions

  • I want to compare two tables and out a boolean

    This should be simple.  I want to compare two tables (5 items) and return a single Boolean value (T/F), not an array of Boolean.

    Thank you

    Kevin

    Right click on the comparison, the comparison mode, select compare the aggregates.

  • compare two table with cluster inside

    Hello

    I want to compare two tables containing a cluster with several groups in it. When you use the equal the result is the same pattern as the cluster of entry. But I just need a true or false. It doesn't bother me that it changed on position 1 or any other position.

    Is there an elegant way to do it?

    Thanks for any help.

    Yves

    Right-click equality and change to compare aggregations. That, or add a table and later.

    /Y

  • Compare two tables, APEX

    Hello

    I am trying to compare two tables, but I want to display values that are the differnet from one to the other,
    both tables have the same columns and have the same PK.

    Thank you.

    Hello

    You probably need a report based on a query like this:

    SELECT
       d1.deptno,
       d1.dname,
       d2.dname,
       d1.loc,
       d2.loc
    FROM
       dept1 d1
       INNER JOIN dept2 d2
       ON d1.deptno = d2.deptno
       AND (      d1.dname <> d2.dname
                OR d1.loc <> d2.loc
              )
    

    You can also consider using FULL JOIN where you have different values of primary key in both tables and you want to include in the report.

  • BUG? Statement of BRIDGE to compare two tables

    Hello

    I tried to compare two tables different dbs and remembered a post on applications to Connectin Cross
    http://barrymcgillin.blogspot.com/2010/11/cross-connection-queries.html
    BRIDGE temparb AS "EB05 01"
    (SELECT * FROM arb)
    (SELECT * FROM temparb 
    MINUS 
    SELECT * FROM arb
    )
    UNION ALL
    (SELECT * FROM arb
    MINUS
    SELECT * FROM temparb 
    );
    I expect to get the differences between the ARB table in my current schema and the table alias temparb arb in the other db. Yet it seems that in this case only the table in my current schema is read.

    I materialize at the table BRIDGE with
    BRIDGE temparb AS "EB05 01"
    (SELECT * FROM arb)
    and select the value that I know to be only in the remote schema
    SELECT id FROM temparb WHERE id = 2562;
    SELECT id FROM arb WHERE id = 2562;
    Both times I get no results. I even tried to use aliases on the table, same result. Tested in EA3 3.0 and 3.1.

    Has anyone tried this before?

    Concerning
    Marcus

    Hi Marcus,

    Have you tried without the quotes around the name of connection?

    I have a named connection
    system_local
    which I run the following command

    drop table testbridge_remote;
    drop table testdbrige;
    create table testbridge (col1 int);
    insert into testbridge values (1);
    insert into testbridge values (2);
    insert into testbridge values (3);
    commit;

    I have a named connection
    Name of the connection with space
    I performed the following in the

    drop table testdbrige;
    create table testbridge (col1 int);
    insert into testbridge values (4);
    insert into testbridge values (5);
    insert into testbridge values (3);
    commit;

    Then I can execute the following statement in the connection of system_local/worksheet

    BRIDGE testbridge_remote as the name of connection with Space(select * from testbridge)
    + (SELECT * FROM testbridge_remote +)
    LESS
    SELECT * from testbridge
    +)+
    UNION ALL
    + (SELECT * FROM testbridge +)
    LESS
    SELECT * from testbridge_remote
    +);+

    It works well.
    Returns the rows in the remote table not in the local table and lines in the local table, not the remote table.

    Kind regards
    Dermot
    SQL development team.

  • Compare two table

    Hello

    can you please help me.

    How can I compare two table. following my code...

    var my_array:Array = Array (5,10,15,20,25,30)
    var new_array:Array = Array (7,8,9,10,11,12,13)
    for (var i: Number = 0; i < my_array.length; i ++) {}
    {if(my_array[i]==new_array[i])}
    trace (my_array [i])
    }
    }

    Thanks in advance,

    JaxNa

    Then, you're almost on correct... See the same code that I modified a little,

    var my_array:Array = Array (5, 10, 15, 20, 25, 30);
    var new_array:Array = Array (7, 10, 9, 10, 10, 30, 13);

    for (var i: Number = 0; i
    If (my_array [i] is {new_array [i]})
    trace ("' my Array'" + i + "("+my_array[i]+")"new_array' "+ i +"("+new_array[i]+") = Matching");
    } else {}
    trace ("' my Array'" + i + "("+my_array[i]+") 'new_array'" + i + "("+new_array[i]+") = is only not to");
    }
    }

    If this is not so, explain exactly what you want

  • Compare two Tables question

    Hello

    I need to compare two tables (T1, T2) and update existing records only in T2, but not in T1. So basically, the lines updated in T2:

    Select * from T2 where T2.id not in (select id from T1).

    What would be a good way to achieve this in ODI?

    I created an ODI interface with a join T2.id not in T1.ID, but it did not work "coz:" ORA-01427: einreihig subquery returns several lines "."

    Appreciate any input/access map.

    Thank you.

    Hi Michele...

    At first glance, there are at least 2 ways to do it:

    (1) put the steps in "(select id from T1)" (you can use an ODI API to get the schema dynamically) as an object filter to T2 (interface), use the incremental update IKM SQL and put "Insert" option on 'No'. " This will do a few updates.

    OR

    (2) in an interface set the T1 and T2 and left join (based on T2) load a temp table where all fields accept the value zero. Next to the columns to update (of course the T2), create an ID column (I named him as T1_Temp_ID) and map the Id of the T1 to it.
    Now just create new interface where the temperature is source and put a filter like "T1_Temp_ID is not null.

    The first option is less complex and can bring better performance.
    The second option gives a better follow-up of the use of the table and the columns, but can be less performatique.

    This help you?

  • compare two tables and update the differences

    Hi all
    Sorry for the newbie question, but I am a beginner in the present.

    I have two tables, both have same structure-

    CODE - code NUMBER (6,0) store is the primary key does not change and is unique
    ADDRESS1
    ADDRESS2
    ADDRESS3 - all VARCHAR2 (100)

    One of the tables is named MASTER, the other being updated. MASTER contains hundreds of lines, while the table of UPDATES may have anywhere from zero to 10 or more.
    I want to compare the table of UPDATES against the MASTER of the table and if there is a difference, ask the differences in the table in UPDATES to the MASTER of table - so if the address of an Exchange store, then the change is reflected in the MASTER table by crushing with the data contained in the UPDATES table.

    I thought that maybe using sliders and compare each field but there must be a more efficient way.

    I hope that I have explained quite clearly... any help would be greatly appreciated.

    Thank you
    Bill

    Education MERGE, assuming that your version supports supported the MERGER.

    SY.

  • How to compare two TABLES and different lines of list?

    I have two structural equal paintings aaa and bbb
    that (could) have different lines.

    How can I compare the tables and display different lines?

    Peter

    Something like this->

    SELECT aaa.*,'bbb' "Not present in" FROM aaa
    MINUS
    SELECT bbb.*,'bbb' "Not present in" FROM bbb
    UNION ALL
    (
    SELECT bbb.*,'aaa' "Not present in" FROM bbb
    MINUS
    SELECT aaa.*,'aaa' "Not present in" FROM aaa
    )
    

    Kind regards.

    LOULOU.

  • Compare two tables that have columns of nulls and undesirable in where clause

    Table A:

    col1col2COL3COL4col5col6

    ANY

    NULL VALUE

    NULL VALUE

    YES

    YES

    YES

    NULL VALUE

    NULL VALUE

    YES

    NULL VALUE

    YES

    YES

    NULL VALUE

    ANY

    YES

    ANY

    NULL VALUE

    YES

    NULL VALUE

    NULL VALUE

    ANY

    YES

    YES

    YES

    Table B:

    col1col2COL3COL4col5col6

    ANY

    NULL VALUE

    NULL VALUE

    YES

    ANY

    YES

    ANY

    NULL VALUE

    YES

    NULL VALUE

    YES

    YES

    NULL VALUE

    ANY

    YES

    NULL VALUE

    NULL VALUE

    YES

    ANY

    NULL VALUE

    ANY

    YES

    YES

    NULL VALUE

    column values

    Yes: Current value

    No: Null

    All: Junk

    Must match all columns in TableA to TableB.

    TableA.col1 to TableB.col1

    .

    .

    .

    TableA.col6 to TableB.col6

    Any help is very appreciated

    Thank you

    Based on your last post that only good data must match exactly and your definition of junk:

    WHERE (decode (substr (A.col5, 1, 1), ' ~ ', 'junk mail', null, 'null', 12/31/9999 ', "junk," A.col5 ") = decode (substr (B.col5, 1, 1), ' ~ ', 'junk mail', null, 'null', 12/31/9999 ',"junk", B.col5"))

    AND (decode (substr (A.col6, 1, 1), ' ~ ', 'junk mail', null, 'null', 12/31/9999 ', "junk," A.col6 ") = decode (substr (B.col6, 1, 1), ' ~ ', 'junk mail', null, 'null', 12/31/9999 ',"junk", B.col6"))

    And so on for the six columns.  This assumes that this junk * still * starts with a ~.  In addition, it assumes that the unnecessary and null words are not in the form of good data.

  • Compare two tables with Look up table

    Hi all

    I basically, I have 3 tables T1, T2 and T3 (Look up table)


    T1

    Col11 Col12

    AA 888
    AA 444
    BB 666
    BB 447
    BB 478
    BB 999


    T2

    Col21 Col22 Col23

    HHH 123 lll
    HHH 123 ppp
    HHH 123 uuu
    GHG 345 kkj
    GHG 345 rer
    uyy 475 hhh


    T3

    Col31 Col32

    AA 123
    AA 345
    AA 564
    BB 564
    BB 475


    I need to know if all the correspondence of values (T3. Col31) Q1. Col11 are in T2. If not what are the missing persons
    I have this table of correspondence T3 to match between T1 T3


    As a data above, I need to get the following out put


    T1. Col11 T3. Col32 T2. Col22 T2. Col23

    AA 123 hhh lll
    AA 123 hhh ppp
    AA 123 hhh uuu
    AA 345 GHG kkj
    AA 345 GHG rer
    AA 564 NULL NULL


    What type of query, I can use to get the result


    See you soon


    Sexy

    Hello
    You just need to use an outer join :)

    SELECT t1.col11,  t3.col32,  t2.col22,  t2.col23
    FROM t1,  t2,  t3
    WHERE t1.col11 = t3.col31
    AND t3.col32 = t2.col21 (+)
    
  • How to compare data from the two table column by column and connect the result compared to the separate table

    Hello experts...

    I'm new to this forum and Oracle coding complex.

    I have a task in which I want to compare two tables with the same structure, same columns. My Oracle database is 11g Release 2. I want this column-by-column comparison and save the result in a separate table. (say result_table)

    The structure of the table would be as follows:

    SQL > desc emp;

    Name                                      Null?    Type

    ----------------------------------------- -------- ----------------------------

    EMPNO NOT NULL NUMBER 4

    ENAME VARCHAR2 (10)

    JOB                                                VARCHAR2(9)

    MGR                                                NUMBER(4)

    HIREDATE DATE

    SAL                                                NUMBER(7,2)

    COMM                                               NUMBER(7,2)

    DEPTNO NUMBER (2)

    SQL > emp_comp desc;

    Name                                      Null?    Type

    ----------------------------------------- -------- ----------------------------

    EMPNO NOT NULL NUMBER 4

    ENAME VARCHAR2 (10)

    JOB                                                VARCHAR2(9)

    MGR                                                NUMBER(4)

    HIREDATE DATE

    SAL                                                NUMBER(7,2)

    COMM                                               NUMBER(7,2)

    DEPTNO NUMBER (2)

    Both of the tables EMPNO is the primary key.

    I want to compare these two tables based on the EMPNO (EMPNO even is both tables).

    The result log table would be as follows:

    SQL > create table result_table

    2 (check_sr_no, number (5),)

    table_name 3 varchar2 (30),

    ROW_ID 4 varchar2 (20).

    column_name 5 varchar2 (20).

    6 column_data varchar2 (1000).

    compared_by 7 varchar2 (10));

    Table created.

    SQL > alter table result_table

    2 Add the constraint result_table_pk

    3 primary key (check_sr_no);

    Modified table.

    The name of the table and the name of the column will not be hardcoded (based parameter by user)

    I tried to use the dbms_comparison package, but do not find comparison of column to column.

    I also used by using the query operator LESS. It's showing the difference in rank.

    I also went to https://asktom.oracle.com/pls/apex/f?p=100:11:0:P11_QUESTION_ID:2151582681236

    Your help will be very appreciated.

    Thank you

    DK

    Tom Kyte has answered this question MANY times over the years. Here are links for its solution

    https://asktom.Oracle.com/pls/Apex/f?p=100:11:0:P11_QUESTION_ID:4934799800346640847

  • Compare two value table

    I want to compare two table value is the same, the result I want is can alert 1,5,6, but the result is now only 6

    var myText1 = "1,3,5,6."

    var myText2 = "+ 1, + 2, 3, + 4, + 5";

    var array1 = myText1.split(",");

    var array2 = myText2.split(",");

    for (var i = 0; i < array1.length; i ++) {}

    ~ alert (array2.toString (.valueOf (array1 [i])));

    If (array2. ToString(). IndexOf (array1 [i]) ==-1) {}

    Alert ("havn't" + array1 [i]);

    }

    }

    Hello

    Delete "var" on line 14

    1,5,6 on my side...

    Jarek

  • By comparing the two tables for the integrity of the data

    Hi all
    I need to compare two tables for the integrity of the data through the SQL query.

    If you need to compare all the columns of t1 to t2:

    (SELECT * FROM t1
    MINUS
    SELECT * FROM t2)
    UNION ALL
    (SELECT * FROM t2
    MINUS
    SELECT * FROM t1);
    

    Kind regards
    Ankit Rouault
    http://theoraclelog.blogspot.in

  • Stored procedure to compare two data tables

    Hello

    I want to have a stored procedure that will compare two tables data (only one column) and remove the line that is not present in the second table.

    For example.,.
    I have 2 tables called Table1 and Table2, that have the same column called ID (PK).
    Data in Table1 are 1,2,3 and data into Table2 are 1.3. When the stored procedure is running, it must compare the ID column in Table1 to ID column in Table2 and since '2' is not there in Table2, I want to remove this line from Table1.

    Thanks in advance.

    delete from table1
    where does not exist (select 1 from table2 where table2.id = table1.my_field)
    ;

Maybe you are looking for

  • Why the latest version has removed the padlock for sites that require a login?

    It takes too much time on the high speed cable, to log my banking online. My body's response was that the latest version of Firefox had removed the icon of the lock for sites that require a connection. I want to know why it was deleted.

  • Satellite A40-151: what DVD-/ + R - RW can I use?

    HelloDoes anyone know what dvd-/ + r - rw I can put in a portable satellite a40 151, I'm curious about a toshiba TS-L532B but I get conflicting answers and have need to know if the caches will be adapted, or if there is any other brand that will work

  • When you type an e-mail address?

    Why tap an email address I no longer see a red line under its or their e-mail address. What does that mean? or why is it happening.

  • kb2760588/kb2760411 updates

    Ive downloaded these two updates, the, new updates icon is still in the status bar, even if the updates succeeded, but still wants to update again icon won't leave. anyone having the same trouble,

  • 8086 3b 64 = driver Intel Management Engine Interface (MEI)?

    I have a new computer that was custom built for me by a shop.The computer works fine, I noticed in Device Manager, however, that in the other devices sectionThere is something called "PCI Simple Communications Controller" which has a yellow exclamati