Comparing data in tables

From: Chris (good_at_asking.com)
Date: 03/13/04

  • Next message: Vishal Parkar: "Re: Comparing data in tables"
    Date: Sat, 13 Mar 2004 07:49:54 -0800
    
    

    Hello,

    I'm trying to compare data between tables for the purpose
    of performing a large update. The first table has 210
    fields (consumer) of which I need to compare 3 of them
    (last, address, zip) to a second table (do_not_mail) that
    only has those 3 fields (last, address, zip).

    The purpose for doing this is, if any record in my large
    table matches a record in the small table, I need to
    update a field in the large table.

    This is the query I'm using but it feels very inefficient
    and I'd like some feedback or suggestions:

    UPDATE consumer SET mail_pander_flag='Y'
    WHERE
    last+address+zip IN
    (SELECT last+address+zip FROM do_not_mail);

    Thank you in advance.

    Chris.


  • Next message: Vishal Parkar: "Re: Comparing data in tables"

    Relevant Pages

    • Re: Sony STB lost EPG once again
      ... If it was working and he updated the firmware the shop will not ... except it back cause it was fit for purpose when sold. ... The firmware was updated by the manufacturer, *not* the customer, who ... Yes i do understand consumer law. ...
      (uk.tech.digital-tv)
    • Re: Sony STB lost EPG once again
      ... except it back cause it was fit for purpose when sold. ... The firmware was updated by the manufacturer, *not* the customer, who ... The goods have been altered. ... A consumer has no rights in respect of defects that are brought to his/her ...
      (uk.tech.digital-tv)
    • Re: No pain, just gain
      ... >>> Cause it doesn't work for that purpose when you go ... >>> back to sighted listining and the difference is still there. ... >>> it is useless for consumer purposes, ... >>> apply to consumer listening. ...
      (rec.audio.opinion)
    • Re: No pain, just gain
      ... >> Cause it doesn't work for that purpose when you go ... >> back to sighted listining and the difference is still there. ... >> it is useless for consumer purposes, ... >> apply to consumer listening. ...
      (rec.audio.opinion)