Results 1 to 9 of 9

Thread: Comparing Two Tables

  1. #1
    Join Date
    Oct 2004
    Location
    India - Mumbai
    Posts
    1

    Comparing Two Tables

    Hi Dear,

    This Code will compare Two Tables.
    And Filter Records from Table1 which R not existing in Table2. I think will help out.

    SELECT A.COL1,
    A.COL2,
    A.COL3,
    A.COL4
    FROM (SELECT COL1,COL2,COL3,COL4 FROM Table1) A
    LEFT OUTER JOIN
    (SELECT COL1,COL2,COL3,COL4 FROM Table2) B
    WHERE (CASE WHEN A.COL1 = B.COL1 THEN 1 ELSE 2 END) = 2

    Thanks & Regards

    Bhudev Prakash

  2. #2
    Join Date
    Jul 2007
    Posts
    3

    sync procedure to compare and update 2 tables

    Can you please advice me on what script should I use to sync procedure to compare and update 2 tables.

    So basically i need two sync parts: First is INSERT of what is not yet existing, second one is UPDATE on the appropriate attributes

    how would i go about doing that.

    Please advice.

    Sincerely,
    parikhm3.

  3. #3
    Join Date
    Sep 2002
    Posts
    5,938
    On which rdbms?

  4. #4
    Join Date
    Jul 2007
    Posts
    3

    Rdbms

    what do you mean by what RDBMS

  5. #5
    Join Date
    Sep 2002
    Posts
    5,938
    Which database system? Oracle, MS SQL or else?

  6. #6
    Join Date
    Jul 2007
    Posts
    3

    Ms Sql

    we are using MS SQL

  7. #7
    Join Date
    Aug 2007
    Posts
    2
    Do you need to update data or table schemas?

  8. #8
    Join Date
    Sep 2002
    Posts
    5,938
    Do you have table schemas? You need sync tables based on whick column?

  9. #9
    Join Date
    Sep 2002
    Location
    Fantasy
    Posts
    4,254

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •