Help needed with comparing two tables

Hi
I have two tables which have same column names but different entries in each one of them and some common entries between the two tables.
Table A has all the entries of Table B and some extra ones.. and I need SQL to give me those extra ones that are not in Table B
Table A columns names (col1, col2 col3 ...) and data
col1 col2 col3 col4 col5 col6
a1 a2 a3 a4 a5 a6
b1 b2 b3 b4 b5 b6
c1 c2 c3 c4 c5 c6
d1 d2 d3 d4 d5 d6
All columns are varchar2
Table B columns names ( col1,col2 ..) and data
col1 col2 col3 col4 col5 col6
a1 a2 a3 a4 a5 a6
c1 c2 c3 c4 c5 c6
All columns are varchar2
So the answer I would like to get is
b1 b2 b3 b4 b5 b6
d1 d2 d3 d4 d5 d6
because these two entries are not in Table B but in Table A
Appreciate if you can help me with this because I have millions of records that I need sort through and get the entries and cannot be done manually..
Thanks in Advance
Kris

Here is an example:
SELECT 'X' FROM DUAL UNION SELECT 'Y' FROM DUAL
MINUS
SELECT 'X' FROM DUAL;
Y

Similar Messages

  • Help needed to compare two Key Figures and show out put

    hello experts,
                       I am comparing the Sales data for two year/month. I need to compare these two KF and show the result only if one is greater than the other by 40%. Sample
    Jan/2008                             Jan /2007
    400                                      600
    500                                      300
    300                                      700
    600                                      400 
    The columns should be outputted only if Jan 2008 is greater than Jan 2007 by 40% for all customers in a business area. Thank you all in advance.
    Regards,
    -Akash

    Hi Akash,
    Your requirement could be met by
    Creating a Calculated Key Figure say variance = ( ( Jan2008 - Jan2007 ) / Jan 2008 ) *100
    Then create a new Condition on  Variance so as to display rows only when Variance > 40
    Hope this solves ur issue.Do revert
    Vasavi

  • Help needed with conditions in Table View

    Another question regarding the dashboard we are building:
    We use a custom function module to display marketing attributes for a particular customer. There are three kinds of marketing attributes of which we want to display the value:
    - Z_QUADRANT
    - Z_SOW
    - Z_WALLET
    If I use the function module as a data service in Visual Composer and use a standard table view as ouput, we get these kind of output:
    Atnam - Atwrt - Atflv - Atzhl (<-- these are the column labels)
    Z_QUADRANT - 4 - 0 - 0
    Z_SOW - 0 - 5 - 0
    Z_WALLET - 0 - 75.000 - 0
    I just want to display the data as follows:
    QUADRANT: 4
    SOW: 5%
    WALLET: 75.000
    So I need to hide the obsolete fields and values and just need to display the relevant values. How can I achieve this? I was guessing I needed to implement some sort of conditional formula like "IF atnam = Z_QUADRANT, display Atwrt(value)" or something, but I am terrible at these kind of things. Can somebody explain it to me or point in the right direction of some good documentation or guide on this? Thanks in advance!
    Best regards,
    Jan Laros

    I now chose to use a form which uses the output from the tables. This is the table I use as input for the form:
    http://tweakers.net/ext/f/DWmYaePz4gdzVhwMJ3naA5UQ/full.jpg
    I use the following formula for the quadrant:
    IF(@ATNAM=="EU_BP_NPS_QUADRANT",@ATWRT,"0")
    This returns a value of "4" which is correct.
    For SOW I use the following formula:
    IF(@ATNAM=="EU_BP_NPS_SOW",@ATFLV,"WRONG")
    Strangely enough the return value is "WRONG" in the form. What am I missing here?
    Regards,
    Jan

  • Comparing Two tables with 300k records and update one table

    Could you let me know how to compare two tables having 300k records and update one table.below is the scenario.
    Table Tabl_1 has columns A,B and Tabl_2 has columns B,new_column.
    Column B has same data in both the tables.
    I need to update Tabl_2 in new_column with Tabl_1 A column data by comparing B column in both tables.
    I m trying to do using PLSQL Tables.
    Any suggestion?
    Thanks.

    Hi,
    Whenever you have a problem, please post a little sample data (CREATE TABLE and INSERT statements, relevant columns only) from all tables involved, so that the people who want to help you can re-create the problem and test their ideas.
    Also post the results you want from that data, and an explanation of how you get those results from that data, with specific examples.
    If you're asking about a DML statement, such as UPDATE, the CREATE TABLE and INSERT statements should re-create the tables as they are before the DML, and the results  will be the contents of the changed table(s) when everything is finished.
    Always say which version of Oracle you're using (for example, 11.2.0.2.0).
    See the forum FAQ: https://forums.oracle.com/message/9362002
    ef2019c7-080c-4475-9cf4-2cf1b1057a41 wrote:
    Could you let me know how to compare two tables having 300k records and update one table.below is the scenario.
    Table Tabl_1 has columns A,B and Tabl_2 has columns B,new_column.
    Column B has same data in both the tables.
    I need to update Tabl_2 in new_column with Tabl_1 A column data by comparing B column in both tables.
    I m trying to do using PLSQL Tables.
    Any suggestion?
    Thanks.
    Why are you trying to use PL/SQL tables?  If tabl_1 and tabl_2 are regular database tables, it will be much simpler and faster just to use them.
    Depending on your requirements, you can do an UPDATE or MERGE, either in SQL or in PL/SQL.

  • URGENT - HELP NEEDED WITH ECC 6.0 ACCESS KEY and USER SETUP

    Please help me with the two issues:
    1) In ECC 6.0, When I go to SE12 , table V-FAGL_ACTIVEC (New GL Activation) to make the table display and maintenance allowed, I am asked for the access key. What is the access key that I am supposed to put here. When I go to DEVACCESS table and put my username, I still dont get the access key.
    2) Also I need to know what should be maintained under SU01 to give a user all authorizations. I have SAP_ALL and SAP_NEW. Is there anyother profile need to be given here. Also do I need to give anything under roles tab in order for the user to have all accesses??

    OK I have TAR for this:
    TAR 4234076.996
    and related issue discussed in regards to 500 Internal Server Error described on Neverending frustration with JDeveloper
    with the TAR number
    TAR 4332393.995
    The latter has been demonstrated and confirmed to be a BUG at this point. For the future updates on this issue please refer to
    Neverending frustration with JDeveloper

  • Help view to get two table entries in search help

    Hi,
    I have created the help view for join two tables and that help view was  called in the selection method for creating search help of the custom table field. since it has show inthe selection screen , it is fetching only one table entries. and the shown entries are displaying but not passing.
    Please provide the steps to get the two table entries and the displayed entries should pass.
    Thanks in Advance,
    siva

    Hi sivanag,
    1. Try your view with SE16/SE16N to see if it really finds what you expect
    2. Use the same data elements in help view as on selection screen
    3. read documentation and F1 help on all fields you see in the search help definition - especially only field marked as EXPORT parameter will be put back on screen.
    But, sincerely, I don't know what your selection-screen looks like.
    Regards,
    Clemens

  • Compare two tables on different server without using Linked Servers

    I have an SSIS package that needs to compare a table to another table on another server.  Then only delete data from the first table if it exists in the second table.  
    I know this is possible with Linked Servers but we are doing away with them in my company.  Is there a way inside of SSIS to do this?
    Oh and I can't use a Data Flow since I don't know the table names or columns at run time (the whole package is dynamic) so I can't map the columns ahead of time.  
    So no MERGE JOIN unless it can be used outside of a Data Flow.  

    You 'll have to use the Data Flow Transformation, thing is, given the constraints, your only option seems to be in generating the package programmatically (using code).
    The type of a program would be a Windows Console. The program would expect a few parameters as the source and target tables along with any necessary connection parameters.
    Then use the merge join (being the easiest to code in) in an Execute SQL Task component.
    Examples of coding packages:
    Samples for creating SSIS packages programmatically
    PS: I can tell you, given your circumstances, at the very minimum the impact on the bottom line of your company is brittle apps accompanied with expensive maintenance which translates into reduced ROI from your tooling.
    Arthur My Blog
    The package is table driven and is a dynamic archival process.  The end user just fills in the framework table and the package archives data from within a certain time range.  The table can exist on any server, any database.  
    That part is done.  The part that still needs to be accomplished is to delete data out of the base table since it is archived.  I need a safe way of doing this and so thought to compare the archive table against the base table.  Because they
    can exist anywhere and can have any name I am not sure how to do this without Linked Servers.  That being said we will not have Linked Servers for this.  
    Is there another safe way to delete data out of the base table?

  • BUG? BRIDGE statement to compare two tables

    Hello,
    I tried to compare two tables in different dbs and remembered a post about Cross Connectin Queries
    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 would expect to get the differences between the table arb in my current schema and the table arb alias temparb in the other db. Yet it seems, that in this case only the table in my current schema is read.
    I materialize the BRIDGE table with
    BRIDGE temparb AS "EB05 01"
    (SELECT * FROM arb)and select the value 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 result. I even tried to use aliases on the table, same result. Tested in 3.0 and 3.1 EA3.
    Has anyone tried this before?
    Regards
    Marcus

    Hi Marcus,
    Have you tried it without the double quotes around the connection name?
    I have a connection called
    system_local
    which I run the following command in
    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 connection called
    Connection Name With Space
    which I run the following in
    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 in the system_local connection/worksheet I can run the following statement
    BRIDGE testbridge_remote as Connection Name With Space(select * from testbridge)
    +(SELECT * FROM testbridge_remote+
    MINUS
    SELECT * FROM testbridge
    +)+
    UNION ALL
    +(SELECT * FROM testbridge+
    MINUS
    SELECT * FROM testbridge_remote
    +);+
    It works ok.
    Returning rows in the remote table not in the local table , and rows in the local table not in the remote table .
    Regards,
    Dermot
    SQL Developer Team.

  • Compare two tables and log the difference

    Hi,
    I want to compare two tables and log the difference in new table with the fields as (old value,new value, column name). The column name should be the changes value column

    Can you show an example?
    SELECT Foo.*, Bar.*
       FROM Foo
            FULL OUTER JOIN
            Bar
            ON Foo.c1 = Bar.c1
               AND Foo.c2 = Bar.c2
               AND Foo.cn = Bar.cn
     WHERE Foo.key IS NULL 
        OR Bar.key IS NULL; 
    Best Regards,Uri Dimant SQL Server MVP,
    http://sqlblog.com/blogs/uri_dimant/
    MS SQL optimization: MS SQL Development and Optimization
    MS SQL Consulting:
    Large scale of database and data cleansing
    Remote DBA Services:
    Improves MS SQL Database Performance
    SQL Server Integration Services:
    Business Intelligence

  • Compare two table columns

    hi all,
    i am using db10g.
    my task is to compare two table's data for example
    table1 is having
    col1 col2 col3
    a b c
    e f g
    table2 is
    col4 col5 col6
    a e c
    e f g
    so i have to compare col1 first record and col4 first record.
    in otherwords first table first column first item with second table first table first value and so on.
    for ex: a= a
    b= e
    c= c etc
    how can i acheive this?
    both are database tables.
    i cannot use minus function because data types are different for the corresponding column
    how can i compare it?
    Thanks..
    Edited by: user13329002 on Jan 13, 2011 1:09 AM

    Hi,
    Try this
    select
        case
            when a.col1 = b.col1 then 'EQUAL' else 'NOT EQUAL' end column1,
        case
            when a.col2 = b.col2 then 'EQUAL' else 'NOT EQUAL' end column2,
        case
            when a.col3 = b.col3 then 'EQUAL' else 'NOT EQUAL' end column3 
    from (select col1,col2,col3,rownum rn from table1) a,
                                (select col1,col2,col3,rownum rn from table2) b where a.rn = b.rn Try to see how you order the rows of the two tables.
    cheers
    VT

  • Help needed with Elements 5.0

    Trying to Edit photos.  Click on Edit icon and I get the Message " Attempt to Access invalid address".  Click OK get message "Unable to connect to editor application.
    What is the problem?   I have unenstalled to program and reinstalled, I have tried repairing from CD.  Nothing works.  Please help.

    I have the disc and re-installed a couple of time. No positive result. PSE 09 which I bought thereafter is giving a lot of problems also!!!
    Date: Wed, 8 Jun 2011 10:31:24 -0600
    From: [email protected]
    To: [email protected]
    Subject: Help needed with Elements 5.0
    Doesn't really help either of us very much but I'm also having the same problem with Elements 5. I downloaded the program so I don't have disks to reinstall. And it seems from the other reply that Adobe has given up with the "old program," which incidentally was working fine until two days ago. Maybe I'll have to think about PSE9!
    >

  • Help needed with BBDM 5.0.1 IP Modem

    Hi I was happily connecting thru the Net via the IP Modem in BBDM ver 5.0.1 all this while. Only this happened yesterday. Accidentally during the connection, my 9500 was disconnected from the USB cable. From that moment on, I cannot access the Net using the IP Modem feature. Tried to reboot the laptop as well as the 9500 but now all I get is the connecting message and then a pop up saying there is a hardware failure in the connecting device (or modem) ie the BB 9500.
    I even uninstalled BBDM 5.0.1 and reinstalled ver 5.0 and also updated back to 5.0.1 - same story. I can still access the Net via the BB browser etc
    Advise please thanks in advance

    I have the disc and re-installed a couple of time. No positive result. PSE 09 which I bought thereafter is giving a lot of problems also!!!
    Date: Wed, 8 Jun 2011 10:31:24 -0600
    From: [email protected]
    To: [email protected]
    Subject: Help needed with Elements 5.0
    Doesn't really help either of us very much but I'm also having the same problem with Elements 5. I downloaded the program so I don't have disks to reinstall. And it seems from the other reply that Adobe has given up with the "old program," which incidentally was working fine until two days ago. Maybe I'll have to think about PSE9!
    >

  • HELP NEEDED WITH ADDAPTER-DVI TO VGA.

    PLEASE ...HELP NEEDED WITH WIRING CROSS OVER....CAN YOU HELP WITH BACK OF PLUG CONNECTIONS...I SORTA UNDERSTAND THE PINOUTS BUT CANT MAKE AN EXACT MACH...WOULD LIKE TO BE 100% SURE...
    ......THIS ENSURES NO SMOKE!!!                                                                                           
    THE CARD IS AN ATI RADEON RX9250-DUAL HEAD-.........ADDAPTER IS DVI(ANALOG)MALE TO VGA(ANALOG)FEMALE.
    ANY HELP VERY MUCH APPRECIATED........ SEEMS YOU NEED TO BE ROCKET SCI TO ATTACH A BLOODY PICTURE...SO THIS HAS BEEN BIG WASTE OF FING TIME!

    Quote from: BOBHIGH on 17-December-05, 09:21:31
    Get over it mate !
    I find it easy t read CAPS...and if you dont like it ...DONT READ IT!
    And why bother to reply...some people have nothing better to do.
    Yes there chep and easy to come by...Ive already got a new one.
    All I wanted was to make a diagram of whats inside the bloody thing...it was a simple question and required a simple answer.
    NO NEED TO A WANKA !!
    I feel a bann comming up.
    Have you tryed Google ? really.. your question is inrelevant. No need to reply indeed.
    Why do you come here asking this question anyway ? is it becouse you have a MSI gfx card ? and the adapter has nothing to do with this ?
    You think you can come in here yelling.. thinking we have to put up with it and accept your style of posting. This is not a MSI tech center.. it's a user to user center.. Your question has nothing to do with MSI relavant things anyway's.
    Google = your friend.
    Quote from: BOBHIGH on 17-December-05, 09:21:31
    it was a simple question and required a simple answer
    Simple for who ? you (buying a new one) ? me ? we ?   .really...........
    Quote from: Dynamike on 16-December-05, 04:11:48
    1: There are allot of diffrent types of those adapters.
    If any of the mods have a problem about my reply.. please pm me.

  • Help needed with Vista 64 Ultimate

    "Help needed with Vista 64 UltimateI I need some help in getting XFI Dolby digital to work
    Okay so i went out and I bought a yamaha 630BL reciever, a digital coaxial s/pdif, and a 3.5mm phono plug to fit perfectly to my XFI Extreme Music
    -The audio plays fine and reports as a PCM stream when I play it normally, but I can't get dolby digital or DTS to enable for some reason eventhough I bought the DDL & DTS Connect Pack for $4.72
    When I click dolby digital li've in DDL it jumps back up to off and has this [The operation was unsuccessful. Please try again or reinstall the application].
    Message Edited by Fuzion64 on 03-06-2009 05:33 AMS/PDIF I/O was enabled under speakers in control panel/sound, but S/PDIF Out function was totally disabled
    once I set this to enabled Dolby and DTS went acti've.
    I also have a question on 5. and Vista 64
    -When I game I normally use headphones in game mode or 2. with my headphones, the reason for this is if I set it on 5. I get sounds coming out of all of the wrong channels.
    Now when I watch movies or listen to music I switch to 5. sound in entertainment mode, but to make this work properly I have to open CMSS-3D. I then change it from xpand to stereo and put the slider at even center for 50%. If I use the default xpand mode the audio is way off coming out of all of the wrong channels.
    How do I make 5. render properly on vista

    We ended up getting iTunes cleanly uninstalled and were able to re-install without issue.  All is now mostly well.
    Peace...

  • Help needed with itunes

    help needed with itunes please tryed to move my itunes libary to my external hard drive itunes move ok and runs fin but i have none of my music or apps or anything all my stuff is in the itunes folder on my external hard drive but there is nothing on ituns how do i get it back help,please

    (Make sure the Music (top left) library is selected before beginning this.)
    If you have bad song links in your library, hilite them and hit the delete button. Then locate the folder(s) where your music is located and drag and drop into the large library window in iTunes ( where your tracks show up). This will force the tunes into iTunes. Before you start, check your preferences in iTunes specifically under the"Advanced" tab, general settings. I prefer that the 1st 2 boxes are unchecked. (Keep iTunes Music folder organized & Copy files to iTunes Music folder when adding to library). They are designed to let iTunes manage your library. I prefer to manage it myself. Suit yourself. If there is a way for iTunes to restore broken links other than locating one song at a time I haven't found it yet. (I wish Apple would fix this, as I have used that feature in other apps.) This is the way I do it and I have approx. 25,000 songs and podcasts and videos at present. Hope this helps.

Maybe you are looking for