Results 1 to 2 of 2
  1. #1
    Join Date
    Sep 2010

    Unhappy Unanswered: Compare and select 2 diff files with same columns

    Respectful SQL Gurus,

    I need to compare 2 different files which have same columns.
    FILE 1 : policy, Amt1, Amt2, Amt3, Amt4, and Amt5... Amt16
    FILE 2 : policy, Amt1, Amt2, Amt3, Amt4, and Amt5....Amt16

    If any amount field in FILE 1 has ZERO, but has a value in the same amount field in FILE 2, then, I need to select that record.

    It will be great, if i can show both values adjucent to each other.
    Example : Policy#, 0.00/500.85

    Any clue will be greatly appreciated. Oh, by the way, i use DB2. but, if you can give a hint in SQL SERVER, I can try change that in DB2.
    Thank you so much

  2. #2
    Join Date
    Dec 2007
    Richmond, VA
    Provided Answers: 5
    First, are you even talking about writing a query against tables? If you are then try looking at outer joins.

Posting Permissions

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