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.

Tags: Database

Similar Questions

  • I create a form based on two tables that have sequences also. When I create insert only row is inserted in the fields in table first and second fields of the table are empty. Why?

    Mr President.

    I create a form based on two tables that have sequences also. When I create insert only row is inserted in the fields in table first and second fields of the table are empty. Why?

    formdoubletables.png

    the page source is

    <?xml version='1.0' encoding='UTF-8'?>
    <ui:composition xmlns:ui="http://java.sun.com/jsf/facelets" xmlns:af="http://xmlns.oracle.com/adf/faces/rich"
                    xmlns:f="http://java.sun.com/jsf/core">
      <af:panelFormLayout id="pfl1">
        <af:group id="Group">
          <af:inputText value="#{bindings.VoucherId.inputValue}" label="#{bindings.VoucherId.hints.label}"
                        required="#{bindings.VoucherId.hints.mandatory}" columns="#{bindings.VoucherId.hints.displayWidth}"
                        maximumLength="#{bindings.VoucherId.hints.precision}"
                        shortDesc="#{bindings.VoucherId.hints.tooltip}" id="it1">
            <f:validator binding="#{bindings.VoucherId.validator}"/>
            <af:convertNumber groupingUsed="false" pattern="#{bindings.VoucherId.format}"/>
          </af:inputText>
          <af:inputDate value="#{bindings.VoucherDate.inputValue}" label="#{bindings.VoucherDate.hints.label}"
                        required="#{bindings.VoucherDate.hints.mandatory}"
                        columns="#{bindings.VoucherDate.hints.displayWidth}"
                        shortDesc="#{bindings.VoucherDate.hints.tooltip}" id="id1">
            <f:validator binding="#{bindings.VoucherDate.validator}"/>
            <af:convertDateTime pattern="#{bindings.VoucherDate.format}"/>
          </af:inputDate>
          <af:inputText value="#{bindings.Credit.inputValue}" label="#{bindings.Credit.hints.label}"
                        required="#{bindings.Credit.hints.mandatory}" columns="#{bindings.Credit.hints.displayWidth}"
                        maximumLength="#{bindings.Credit.hints.precision}" shortDesc="#{bindings.Credit.hints.tooltip}"
                        id="it2">
            <f:validator binding="#{bindings.Credit.validator}"/>
          </af:inputText>
        </af:group>
        <af:group id="g1">
          <af:inputText value="#{bindings.Lineitem.inputValue}" label="#{bindings.Lineitem.hints.label}"
                        required="#{bindings.Lineitem.hints.mandatory}" columns="#{bindings.Lineitem.hints.displayWidth}"
                        maximumLength="#{bindings.Lineitem.hints.precision}" shortDesc="#{bindings.Lineitem.hints.tooltip}"
                        id="it3">
            <f:validator binding="#{bindings.Lineitem.validator}"/>
            <af:convertNumber groupingUsed="false" pattern="#{bindings.Lineitem.format}"/>
          </af:inputText>
          <af:inputText value="#{bindings.VoucherId1.inputValue}" label="#{bindings.VoucherId1.hints.label}"
                        required="#{bindings.VoucherId1.hints.mandatory}"
                        columns="#{bindings.VoucherId1.hints.displayWidth}"
                        maximumLength="#{bindings.VoucherId1.hints.precision}"
                        shortDesc="#{bindings.VoucherId1.hints.tooltip}" id="it4">
            <f:validator binding="#{bindings.VoucherId1.validator}"/>
            <af:convertNumber groupingUsed="false" pattern="#{bindings.VoucherId1.format}"/>
          </af:inputText>
          <af:inputText value="#{bindings.Debit.inputValue}" label="#{bindings.Debit.hints.label}"
                        required="#{bindings.Debit.hints.mandatory}" columns="#{bindings.Debit.hints.displayWidth}"
                        maximumLength="#{bindings.Debit.hints.precision}" shortDesc="#{bindings.Debit.hints.tooltip}"
                        id="it5">
            <f:validator binding="#{bindings.Debit.validator}"/>
          </af:inputText>
          <af:inputText value="#{bindings.Credit1.inputValue}" label="#{bindings.Credit1.hints.label}"
                        required="#{bindings.Credit1.hints.mandatory}" columns="#{bindings.Credit1.hints.displayWidth}"
                        maximumLength="#{bindings.Credit1.hints.precision}" shortDesc="#{bindings.Credit1.hints.tooltip}"
                        id="it6">
            <f:validator binding="#{bindings.Credit1.validator}"/>
          </af:inputText>
          <af:inputText value="#{bindings.Particulars.inputValue}" label="#{bindings.Particulars.hints.label}"
                        required="#{bindings.Particulars.hints.mandatory}"
                        columns="#{bindings.Particulars.hints.displayWidth}"
                        maximumLength="#{bindings.Particulars.hints.precision}"
                        shortDesc="#{bindings.Particulars.hints.tooltip}" id="it7">
            <f:validator binding="#{bindings.Particulars.validator}"/>
          </af:inputText>
          <af:inputText value="#{bindings.Amount.inputValue}" label="#{bindings.Amount.hints.label}"
                        required="#{bindings.Amount.hints.mandatory}" columns="#{bindings.Amount.hints.displayWidth}"
                        maximumLength="#{bindings.Amount.hints.precision}" shortDesc="#{bindings.Amount.hints.tooltip}"
                        id="it8">
            <f:validator binding="#{bindings.Amount.validator}"/>
            <af:convertNumber groupingUsed="false" pattern="#{bindings.Amount.format}"/>
          </af:inputText>
        </af:group>
        <f:facet name="footer">
          <af:button text="Submit" id="b1"/>
          <af:button actionListener="#{bindings.CreateInsert.execute}" text="CreateInsert"
                     disabled="#{!bindings.CreateInsert.enabled}" id="b2"/>     
          <af:button actionListener="#{bindings.Commit.execute}" text="Commit" disabled="#{!bindings.Commit.enabled}"
                     id="b3"/>
          <af:button actionListener="#{bindings.Rollback.execute}" text="Rollback" disabled="#{!bindings.Rollback.enabled}"
                     immediate="true" id="b4">
            <af:resetActionListener/>
          </af:button>
        </f:facet>
      </af:panelFormLayout>
    </ui:composition>
    
    
    
    

    Concerning

    Go to your VO Wizard, select the tab of the entity and to check if both the EO is editable or not.

    See you soon

    AJ

  • Two tables that have a relationship as "many-to-many" and "one-to-many.

    I have the next two represents tables users and the other represents the items where each item can have an author (user) and of course, users can create a lot of articles, so the one-to-many relationship: -.

    1. users: -.
    User_id (primary_key)
    User_name
    User_sex
    user_address

    2.ARTICILES: -.
    Article_id
    Text
    Author_id (foreign key to the users.user_id)

    but the problem I have been facing is that, on another requirement each items can have several (users) approval before being published, so in this way have become the many-to-many relationship, so I created a third table called "trusts": -.

    3.approval: -.
    approval_id (foreign key to the users.user_id)
    article_id (foreign key to the articles.article_id)
    level.

    so is this a good approach to flow, or there is another way I can better build these tables.

    Hello
    Relationship seems to be ok for your current condition. but make sure you have sequence approval on your table to the approval, in case you should find the flow of approvals.

    See you soon
    Kanchana

  • How to find the names of tables that have more than 100 columns

    Hi gurus,

    Please help me find the names of the tables that have more than 100 columns in the database.

    Below will be useful for you.

    SELECT atc.OWNER,atc.TABLE_NAME,count(*)
    FROM all_tab_columns atc
    GROUP BY  atc.OWNER,atc.TABLE_NAME
    HAVING count(atc.COLUMN_NAME) > 100
    

    Adding another point, you can use user_tab_columns, all_tab_columns, dba_tab_columns, based on your needs/access.

    Thank you
    Suri

    Published by: Suri on February 23, 2012 11:30

  • Find all tables that have not at least a DATE column

    DB version: 10 gr 2

    View user_tab_cols using, how can I find the tables that have not at least a column of DATE(user_tab_cols.data_Type='DATE')?
    SELECT table_name
      FROM user_tables
    WHERE table_name NOT IN  ( SELECT DISTINCT
                                      table_name
                                 FROM user_tab_cols
                                WHERE DATA_TYPE  = 'DATE'
                             );
    

    Concerning
    Arun

  • 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.

  • two elements that have the same source

    Hi guys,.

    I am trying to use the display on a Google Map plugin location. As I had this plugin requires two elements that have the same source:

    Article 1 - A text to insert the value (address) in the database. The source of this question would be 'MAP' column.
    2 - Google Map plugin ELEMENT to visualize on the map. The source of this issue should also be "Map" the column that is used to read the address.

    But the problem, as you saw, we can not create a new record if we have two items with the same source. How can I get around this?

    Here is the link to the plugin:

    http://Apex.Oracle.com/pls/Apex/f?p=plugins:LOCATION_MAP:2943553726537511

    Kind regards
    Fateh

    Published by: Fateh July 21, 2011 02:52

    Hi Fateh,

    Tried the plugin you mentioned! Had a preview of your problem.
    >
    I am trying to use the display on a Google Map plugin location. As I had this plugin requires two elements that have the same source
    >
    As your form seems to be running automatic process line processing DML that will obviously give an error if you have two items
    with the same source i.e. 'MAP' that is your database column.
    >
    Article 1 - A text to insert the value (address) in the database. The source of this question would be 'MAP' column.
    >
    I think that this point is already with you as you may have created form based on a Table or form and report based on a Table.
    Leave the source of this article because it's IE card - the database column.
    >
    2 - Google Map plugin ELEMENT to visualize on the map.
    >
    Change the source of this article as:
    Source type: static assignment (value corresponds to the source attribute)
    Source of value or expression:

    &P1_ADDRESS.
    

    Where P1_ADDRESS is the element:
    >
    Article 1 - A text to insert the value (address) in the database. The source of this question would be 'MAP' column.
    >

    I hope that helps!
    Kind regards
    Kiran

  • 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.

  • 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 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

  • find tables that have no data

    Hi guys,.

    I have the schema name but who want to find the names of all tables which do not have all the data, perhaps no records = 0.

    I also want to find then of these tables that have names of data columns and then I want a search on that columns with column name

    Need help. Your help would be really appreciated.

    Thank you

    If the statistics are correctly collected in the schema, then:

    select * from user_tables where num_rows=0 ----->  (you may user all_tables/dba_tables);
    

    And I do not understand your second question.

    I also want to find then of these tables that have names of data columns and then I want a search on that columns with column name

    Not sure if this is what you need...

    SELECT *
      FROM user_tab_cols
     WHERE table_name IN (SELECT table_name
                            FROM user_tables
                           WHERE num_rows <> 0);
    

    See you soon,.

    Manik.

  • 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

  • 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.

  • It's been two months that I downloaded photoshop cs6 and it was fine, but now when I try to open the program, he said that I have to uninstall. When I go to the control panel and click on uninstall, so I can install it again, it just says: I need to clean

    It's been two months that I downloaded photoshop cs6 and it was fine, but now when I try to open the program, he said that I have to uninstall. When I go to the control panel and click on uninstall, so I can install it again, it just says: I need to clean my computer or restart, because it can not uninstall the program. I already did and it is still not uninstall. How should I proceed?

    run the cleaner, the use of the CC cleaning tool to resolve installation problems. CC, CS3 - CS6

    and then reinstall it.

    Available downloadable Setup files:

    Download and installation help links Adobe

    Help download and installation to Prodesigntools links can be found on the most linked pages.  They are essential; especially steps 1, 2 and 3.  If you click on a link that does not have these listed steps, open a second window by using the link to Lightroom 3 to see these "important Instructions".

Maybe you are looking for