Uncommon records from two table

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • mani85
    New Member
    • Jul 2008
    • 2

    Uncommon records from two table

    HI,

    I have two tables.I want to retrieve the uncommon records from two tables.

    I m using the queries :

    select col1,col2 from table 1
    where rtrim(col1+'-'+col2) not in
    (select rtrim(col1+'-'+col2) from table 2)

    i have used this query also :

    select rtrim(col1+'-'+col2+'-'+col3+'-'+col4) from table 1
    except
    select rtrim(col1+'-'+col2+'-'+col3+'-'+col4) from table 2


    The problem is that these two queries are taking huge time for execution.

    First table has around 1 lakh records
    and the second one is havoin 10.000 records.

    Logically,i knw it would take time but is n't there ny another alternative for this ?

    thanks
  • debasisdas
    Recognized Expert Expert
    • Dec 2006
    • 8119

    #2
    What exactly you mean by uncommon records

    Comment

    • ck9663
      Recognized Expert Specialist
      • Jun 2007
      • 2878

      #3
      Are you talking about this ?

      -- CK

      Comment

      Working...