Comparing data in tables
From: Chris (good_at_asking.com)
Date: 03/13/04
- Previous message: Vishal Parkar: "Re: I need a query"
- Next in thread: Vishal Parkar: "Re: Comparing data in tables"
- Reply: Vishal Parkar: "Re: Comparing data in tables"
- Messages sorted by: [ date ] [ thread ]
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.
- Previous message: Vishal Parkar: "Re: I need a query"
- Next in thread: Vishal Parkar: "Re: Comparing data in tables"
- Reply: Vishal Parkar: "Re: Comparing data in tables"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|
|