Results 1 to 5 of 5

Thread: Comparing Tables..

  1. #1
    Mano Guest

    Comparing Tables..

    Hi ,
    I have three tables T1 , T2 AND T3. T3 is having fields as a combination of T1 and T2 fields.How can I compare T1 and T2 field values with T3 FIELD VALUES.



  2. #2
    Ananth Guest

    Comparing Tables.. (reply)

    Can you be a little more specific? Do you need to compare all the values in T1 & T2 joined to the values in T3? Do you just want to ensure that every row in T1+T2 has a matching row in T3?



    ------------
    Mano at 5/3/01 9:05:08 AM

    Hi ,
    I have three tables T1 , T2 AND T3. T3 is having fields as a combination of T1 and T2 fields.How can I compare T1 and T2 field values with T3 FIELD VALUES.



  3. #3
    Ali Mostofi Guest

    Comparing Tables.. (reply)

    Hi

    Please let us know more about your problem, it isn't clear to us
    what do you realy want to do !


    Thanks
    Ali


    ------------
    Ananth at 5/3/01 9:24:20 AM

    Can you be a little more specific? Do you need to compare all the values in T1 & T2 joined to the values in T3? Do you just want to ensure that every row in T1+T2 has a matching row in T3?



    ------------
    Mano at 5/3/01 9:05:08 AM

    Hi ,
    I have three tables T1 , T2 AND T3. T3 is having fields as a combination of T1 and T2 fields.How can I compare T1 and T2 field values with T3 FIELD VALUES.



  4. #4
    Mano Guest

    Comparing Tables.. (reply)

    Hi,
    I have a table T1 (with columns like c1,c2,c3) and a table T2 (with columns like c4,c5,c6,c7) which are joined by a primary key.
    I have one more table T3 which contains few colums from T1 and few columns from T2(SAY c1,c3,c5,c6,c7).
    I need to compare the values of all rows in T3 with values of T1 and T2 table
    and whatever fields mismatch have to write into to error message field like 3,6 (where 3 and 6 are field names not matched) in the coressponding row.

    Thanks,
    Mano.


    ------------
    Ali Mostofi at 5/3/01 9:56:31 AM

    Hi

    Please let us know more about your problem, it isn't clear to us
    what do you realy want to do !


    Thanks
    Ali


    ------------
    Ananth at 5/3/01 9:24:20 AM

    Can you be a little more specific? Do you need to compare all the values in T1 & T2 joined to the values in T3? Do you just want to ensure that every row in T1+T2 has a matching row in T3?



    ------------
    Mano at 5/3/01 9:05:08 AM

    Hi ,
    I have three tables T1 , T2 AND T3. T3 is having fields as a combination of T1 and T2 fields.How can I compare T1 and T2 field values with T3 FIELD VALUES.



  5. #5
    Ananth Guest

    Comparing Tables.. (reply)

    You can use IF EXISTS ...with an INLINE query :


    SELECT * from T3
    WHERE NOT EXISTS (SELECT T1_2.* FROM
    (SELECT T1.C1, T1.C3, T2.C5, T2.C6, T2.C7
    FROM T1, T2
    WHERE T1.C1 = T2.C1 -- assume that is the join key
    ) AS T1_2
    WHERE T1_2.C1 = T3.C1
    AND T1_2.C3 = T3.C3
    AND T1_2.C5 = T3.C5
    AND T1_2.C6 = T3.C6
    AND T1_2.C7 = T3.C7 )

    ....you get the idea

    You could also create a view joining T1 and T2 and check against that

    ------------
    Mano at 5/3/01 10:35:09 AM

    Hi,
    I have a table T1 (with columns like c1,c2,c3) and a table T2 (with columns like c4,c5,c6,c7) which are joined by a primary key.
    I have one more table T3 which contains few colums from T1 and few columns from T2(SAY c1,c3,c5,c6,c7).
    I need to compare the values of all rows in T3 with values of T1 and T2 table
    and whatever fields mismatch have to write into to error message field like 3,6 (where 3 and 6 are field names not matched) in the coressponding row.

    Thanks,
    Mano.


    ------------
    Ali Mostofi at 5/3/01 9:56:31 AM

    Hi

    Please let us know more about your problem, it isn't clear to us
    what do you realy want to do !


    Thanks
    Ali


    ------------
    Ananth at 5/3/01 9:24:20 AM

    Can you be a little more specific? Do you need to compare all the values in T1 & T2 joined to the values in T3? Do you just want to ensure that every row in T1+T2 has a matching row in T3?



    ------------
    Mano at 5/3/01 9:05:08 AM

    Hi ,
    I have three tables T1 , T2 AND T3. T3 is having fields as a combination of T1 and T2 fields.How can I compare T1 and T2 field values with T3 FIELD VALUES.



Posting Permissions

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