Data not eisting in tables

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • wol497
    New Member
    • Jan 2009
    • 1

    Data not eisting in tables

    I amm having one of those DBA brain locks. I have two tables lets say table_1 and Table_2. The Join column in both (indexed) is col_1 ( variable character 75 ).

    what I need to do is produce a record of those records in Table_1 that are not in
    Table_2

    over simplified example Data

    Table_1 Col_1 Table_2 Col_1

    abcd abcd
    wxyz egka
    wxyz wxyz

    the Query needs to return "egka"
  • sagark
    New Member
    • Jan 2009
    • 12

    #2
    You can use query something like this -

    "Select Col_2 from Table_2 where Col_2 not in (Select Col_1 from Table_1)"

    Comment

    • ck9663
      Recognized Expert Specialist
      • Jun 2007
      • 2878

      #3
      Be careful with NOT IN. Read this and this.

      Happy Coding!

      -- CK

      Comment

      Working...