Results 1 to 2 of 2
  1. #1
    Join Date
    May 2004

    Unanswered: Comparing field in 2 tables

    I am trying to compare a similar field in 2 tables to find where entry exists in tab1 but not in tab2. I am running the following sql to get this but can't find what I am doing wrong. Any help would be greatly appreciated.

    when I run this:

    select tab1.dets_t from tab1 where tab1.dets_t not in ( tab2.dets_t );

    I get error:
    217: Column (tab1) not found in any table in the query (or SLV is undefined).
    Error in line 1
    Near character position 56

    Last edited by gbokas; 05-28-04 at 12:59.

  2. #2
    Join Date
    Dec 2003
    North America

    compare values in two tables

    Hi gbokas,

    You need to include a "select" on the second table

    select column_value from first_table
    where column_value not in
    (select column_value
    from second_table)

    This should work, but if you have a problem try
    selecting a UNIQUE value from second_table

    good luck


Posting Permissions

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