From: Daevid Vincent Date: March 15 2007 8:13am Subject: RE: Possible in sql, or just move it to a language List-Archive: http://lists.mysql.com/mysql/205615 Message-Id: <006901c766d9$da58d660$450a0a0a@locutus> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit I'm just guessing at this, but I think this is a simple update: UPDATE table1, table2 SET table2.needs_purging = 1 WHERE table1.bounce_email = table2.email http://dev.mysql.com/doc/refman/5.1/en/update.html You could also do this same logic with the delete I believe: DELETE table2 FROM table1, table2 WHERE table1.bounce_email = table2.email http://dev.mysql.com/doc/refman/5.1/en/delete.html > -----Original Message----- > From: Scott Haneda [mailto:lists@stripped] > Sent: Thursday, March 15, 2007 12:20 AM > To: mysql@stripped > Subject: Possible in sql, or just move it to a language > > This is a one off I need to do > > Table1 has email addresses in it, table two also has email > addresses in it. > table1 represents bounced emails that need to be purged from > the database. > > What I would like to do, is mark a field in table2, called > "needs_purging" > to true, when there is a match from table 1 > > Should I just run a loop in my language of choice, or is > there a join I am > not seeing here? > -- > ------------------------------------------------------------- > Scott Haneda Tel: 415.898.2602 > Novato, CA U.S.A. > > > > -- > MySQL General Mailing List > For list archives: http://lists.mysql.com/mysql > To unsubscribe: > http://lists.mysql.com/mysql?unsub=daevid@stripped > >