How to find the unmatched records between the two tables?

We have to tables in SQL Server database.
But unable to find the unmatched record betwwen these two tables.
There 12 records are unmatched. But unable to get those records.
I am using the below sql:
select c1,c2,c3,c4,c5,c6 from Table1
except select c1,c2,c3,c4,c5,c6 from Table2
Please help. Thanks in advance.

Hi knra,
Please try the following codes:
select c1,c2,c3,c4,c5,c6 from Table1 t1
where not exists
(select * from Table2 t2
where t1.c1= t2.c1
and t1.c2= t2.c2
and t1.c3= t2.c3
and t1.c4= t2.c4
and t1.c5= t2.c5
and t1.c6= t2.c6)
Best Regards,
Allen Li
Allen Li
TechNet Community Support
This is what I would've said, but it would make life much easier for you if you have a reference or ID for each entry, this is why we use keys.

Similar Messages

  • How to find last inserted record in the table.

    Version: Oracle 10g
    I have a table called "Manufacture" and 3 columns as mfno,itemname,quantity.
    How to find last inserted record in the table "Manufacture".
    As i come to know that Rowid is not result perfect results. Please provide your inputs.

    user13416294 wrote:
    Version: Oracle 10gThat is not a version. That is a product name. A version is 10.1.0.2 or 10.2.0.4, etc.
    I have a table called "Manufacture" and 3 columns as mfno,itemname,quantity.
    How to find last inserted record in the table "Manufacture".Not possible as your data model does not cater for it. That simple.
    If there is a need to determine some order or associate some time to an entity, then that should be part of the data model - and a relationship, or one or more attributes are needed to represent that information. Thus your data model in this case is unable to meet your requirements.
    If the requirements are valid, fix the data model. In other words - your question has nothing to do with Oracle and nothing to do with rowid, rowscn or other pseudo columns in Oracle. It is a pure data modeling issue. Nothing more.

  • How to find the last records of the table in adventure work db

    hi all,
    i want to find out " how to receive a last records of the table (eg:  person.emailaddress ) in sql 2008 and 2005"
    Thanks

    If you are looking for the latest record( the one which got inserted/modified last) then use this query
    select top 1 * from person.emailaddress
    Order by ModifiedDate desc
    Satheesh
    My Blog |
    How to ask questions in technical forum

  • I HAVE A SOURCE TABLE WITH 10 RECORDS AND TARGET TABLE 15 RECORDS. MY WUESTION IS USING WITH THE TABLE COMPARISON TRANSFORM I WANT TO DELETE UNMATCHED RECORDS FROM THE TARGET TABLE ??

    I HAVE A SOURCE TABLE WITH 10 RECORDS AND TARGET TABLE 15 RECORDS. MY QUESTION IS USING WITH THE TABLE COMPARISON TRANSFORM .I WANT TO DELETE UNMATCHED RECORDS FROM THE TARGET TABLE ?? HOW IT IS ??

    Hi Kishore,
    First identify deleted records by selecting "Detect deleted rows from comparison table" feature in Table Comparison
    Then Use Map Operation with Input row type as "delete" and output row type as "delete" to delete records from target table.

  • How to find out which type of the driver is used in our application?

    Hi all,
    can anyone tell me how to find out which type of the driver is used in our application?
    Thanks in advance,
    Phoeniox

    Hi,
    Check out this...
    Class.forName("com.mysql.jdbc.Driver"); //if u r using MySql
    List drivers = Collections.list(DriverManager.getDrivers());
                   for(int i=0;i<drivers.size();i++)
                        Driver driver = (Driver)drivers.get(i);
                        String driverName = driver.getClass().getName();
                        System.out.println("Driver "+i+":::"+driverName);
    you need to load the driver and display in the same program.
    Then only you'l get the required result.
    prakhyath

  • How to find out who has deleted the production Query

    Hi All,
    I have searche SD , i can find it for infoobject deletion but i couldn't find it for Query.
    Please let me know is there any possiblity to kow
        How to find out who has deleted the production Query
    Awaiting for your replies.
    cheers

    Hi Mahesh and all,
    Thanks for all your  inputs.
    I have tried with RSRREPDIR tabel , I am unable to see that query at all.
    If I use theT-code SLG1,
      please guide me on the steps with paramets to be given in the respective ..object, subobject etc..
    OR
    could you please suggest any other way.
    cheers
    leena

  • How to find out who had deleted the function moldule? S O S

    how to find out who had deleted the function moldule Thank you very much.

    if this fm was assigned to device class (package) you'll find it in
    tables tadir, e070, e071
    try with name of function module or function group
    hope that helps
    Andreas

  • How to find out what are all the change pointers assoicated for an idoc ??

    Hi ,
    How to find out what are all the change pointers activated for an idoc ??
    Thanks,
    Varma

    Verma,
    You can check what are the active Change Pointers for the message type in tcode <b>BD50</b>
    Use tcode <b>BD61</b> to check whether change pointers are active or not??
    Hope this helps..

  • How many steps can be recorded in the History panel?

    In Photoshop, 20 steps can be recorded in the Histroy panel with the defult setting, and we can change the setting to record more or less steps by choosing "Edit> Preference".
    In Lightroom, how many steps can be recorded in the History panel with the defult setting? And how can we change the number of step to be recorded?

    I guess since the history is kept in the database (and not only in memory as with PS), there is not so much an issue in limiting them.
    Beat Gossweiler
    Switzerland

  • Sql query to find the space in between the sentense

    hi,
    can anybody tell me the query to find the space in between the data
    chandan

    Not sure what you mean, but you might want to take a look at INSTR, like in
    instr (txt, ' ')

  • How to know the parameters passed between the pages

    Hi , am working on the customizations.
    Can anybody tell me how to know the parameters passed between the pages in OAF.
    Thanks a lot in advance.
    regards
    kumar

    U can read
    Framework ToolBox Tutorial Lesson 2, Part 4: Page-to-Page Communication
    in this path
    <<your OAF folder>>jdevdoc\WebHelp\toolbox\510\lessons\lesson2_pagecom.htm
    OAPageContext
    PutEncryptedParameter( )
    GetDecryptedParameter( )
    OAPageContext (called from UI client)
    putTransactionValue( )
    getTransactionValue( )
    removeTransactionValue( )
    OADBTransaction (called from server)
    putValue( )
    getValue( )
    removeValue( )
    OAPageContext (called from UI client)
    TIP the Framework expects to introduce methods for managing session data from the server at some point in the future.
    putSessionValue( )
    removeSessionValue( )
    getSessionValue( )
    Good luck !

  • How to find which function module write the relevant idoctype?

    Dear All,
    how to find which function module write the relevant idoctype?

    Hi,
    Generally the function modules of the idoc types are having a naming convention as IDOC_INPUT for inbound processing and IDOC_OUTPUT for outbound processing followed by the idoc type name
    for example : For IDOC type ORDERS
    the inbound function module will be IDOC_INPUT_ORDERS and for outbound IDOC_OUTPUT_ORDERSP
    In this way you can find the function module for a particular IDOC
    P.S: Hope this is what you have asked for
    Regards
    Sarves

  • How to find user exit implemented in the program

    how to find user exit implemented in the program or standerd transaction

    try this program to get the list of all the user exits for a transaction...
    *& Report  Z_USER_EXIT                                                 *
    *REPORT  Z_USER_EXIT                             .
    REPORT z_find_userexit NO STANDARD PAGE HEADING.
    *&  Enter the transaction code that you want to search through in order
    *&  to find which Standard SAP User Exits exists.
    *& Tables
      TABLES : tstc,     "SAP Transaction Codes
               tadir,    "Directory of Repository Objects
               modsapt,  "SAP Enhancements - Short Texts
               modact,   "Modifications
               trdir,    "System table TRDIR
               tfdir,    "Function Module
               enlfdir,  "Additional Attributes for Function Modules
               tstct.    "Transaction Code Texts
    *& Variables
      DATA : jtab LIKE tadir OCCURS 0 WITH HEADER LINE.
      DATA : field1(30).
      DATA : v_devclass LIKE tadir-devclass.
    *& Selection Screen Parameters
      SELECTION-SCREEN BEGIN OF BLOCK a01 WITH FRAME TITLE text-001.
      SELECTION-SCREEN SKIP.
      PARAMETERS : p_tcode LIKE tstc-tcode OBLIGATORY.
      SELECTION-SCREEN SKIP.
      SELECTION-SCREEN END OF BLOCK a01.
    *& Start of main program
      START-OF-SELECTION.
    Validate Transaction Code
        SELECT SINGLE * FROM tstc
          WHERE tcode EQ p_tcode.
    Find Repository Objects for transaction code
        IF sy-subrc EQ 0.
          SELECT SINGLE * FROM tadir
             WHERE pgmid    = 'R3TR'
               AND object   = 'PROG'
               AND obj_name = tstc-pgmna.
          MOVE : tadir-devclass TO v_devclass.
          IF sy-subrc NE 0.
            SELECT SINGLE * FROM trdir
               WHERE name = tstc-pgmna.
            IF trdir-subc EQ 'F'.
              SELECT SINGLE * FROM tfdir
                WHERE pname = tstc-pgmna.
              SELECT SINGLE * FROM enlfdir
                WHERE funcname = tfdir-funcname.
              SELECT SINGLE * FROM tadir
                WHERE pgmid    = 'R3TR'
                  AND object   = 'FUGR'
                  AND obj_name = enlfdir-area.
              MOVE : tadir-devclass TO v_devclass.
            ENDIF.
          ENDIF.
    Find SAP Modifactions
          SELECT * FROM tadir
            INTO TABLE jtab
            WHERE pgmid    = 'R3TR'
              AND object   = 'SMOD'
              AND devclass = v_devclass.
          SELECT SINGLE * FROM tstct
            WHERE sprsl EQ sy-langu
              AND tcode EQ p_tcode.
          FORMAT COLOR COL_POSITIVE INTENSIFIED OFF.
          WRITE:/(19) 'Transaction Code - ',
          20(20) p_tcode,
          45(50) tstct-ttext.
          SKIP.
          IF NOT jtab[] IS INITIAL.
            WRITE:/(95) sy-uline.
            FORMAT COLOR COL_HEADING INTENSIFIED ON.
            WRITE:/1 sy-vline,
            2 'Exit Name',
            21 sy-vline ,
            22 'Description',
            95 sy-vline.
            WRITE:/(95) sy-uline.
            LOOP AT jtab.
              SELECT SINGLE * FROM modsapt
              WHERE sprsl = sy-langu AND
              name = jtab-obj_name.
              FORMAT COLOR COL_NORMAL INTENSIFIED OFF.
              WRITE:/1 sy-vline,
              2 jtab-obj_name HOTSPOT ON,
              21 sy-vline ,
              22 modsapt-modtext,
              95 sy-vline.
            ENDLOOP.
            WRITE:/(95) sy-uline.
            DESCRIBE TABLE jtab.
            SKIP.
            FORMAT COLOR COL_TOTAL INTENSIFIED ON.
            WRITE:/ 'No of Exits:' , sy-tfill.
          ELSE.
            FORMAT COLOR COL_NEGATIVE INTENSIFIED ON.
            WRITE:/(95) 'No User Exit exists'.
          ENDIF.
        ELSE.
          FORMAT COLOR COL_NEGATIVE INTENSIFIED ON.
          WRITE:/(95) 'Transaction Code Does Not Exist'.
        ENDIF.
    Take the user to SMOD for the Exit that was selected.
      AT LINE-SELECTION.
        GET CURSOR FIELD field1.
        CHECK field1(4) EQ 'JTAB'.
        SET PARAMETER ID 'MON' FIELD sy-lisel+1(10).
        CALL TRANSACTION 'SMOD' AND SKIP FIRST SCREEN.

  • Hi In TB how can I delete or disable the wide pane between the list and message pane?

    Hi
    In Tb 24.6.0 how can I delete or disable the wide pane between the list and message pane?
    Thank you.

    You cannot delete it. It is part of the message pane.
    You can make it smaller with this add on.
    https://addons.mozilla.org/en-US/thunderbird/addon/compactheader/?src=ss

  • How do a get a record of the apps I have downloaded

    How do a get a record of the apps I have downloaded

    You can view the apps that are still available in your country's app store via the Purchased tab in the App Store app on your phone.
    If you want to view your account's purchase history then log into your account on your computer's iTunes via the Store > View Account menu option, you should then see a Purchase History section with a 'see all' link to the right of it. Click on that and you should then see a list of your purchases. That should show free as well as paid-for items. On your phone you can view the last 90 days purchases via http://reportaproblem.apple.com.
    You can't view a list of actual downloads (e.g. you can't view how many times, and when, you've downloaded a particular app), only what you've purchased (included free items).

Maybe you are looking for

  • How to transfer files from one iPad to a new iPad

    I am trying to transfer all my files from an iPad 2 to a new iPad 2 as the glass on the old one has broken. They both work. Thanks

  • ITunes.rsrc Colored Icons

    Hello all, I recently upgraded to iTunes 10.1 and was annoyed to see that my "hacked" colored icons (if you don't know what I'm talking about, see http://obamapacman.com/2010/09/how-to-add-color-icons-apple-itunes-10-gray-sideb ar-mod/ ) had disappea

  • CMS.exe wont start: FWM 01003

    HI All, I seem to be having some issues with getting BO XI running.  THis is what anyone gets when logging into BO: Error: Server ****** not found or server may be down (FWM 01003) null Nothing has changed in terms of server ports no datasource.  Now

  • ERROR: insufficient privileges while using EXPLAIN PLAN command

    Hi, I have a table named TEST and i ran following command on this table. SQL> EXPLAIN PLAN FOR 2 SELECT NAME FROM TEST; SELECT NAME FROM TEST ERROR at line 2: ORA-01031: insufficient privileges So which privilege do i need to give for using EXPLAIN P

  • I need to know how to download a copy of CS5

    The computer this was installed had had a catastrophic failure and I don't have the disks.  I have my serial number I just need the software.  Anyone know where I can download it?