APM: DBI multi table delete

Dennis Moore rainking at feeding.frenzy.com
Mon Feb 23 14:39:28 CST 2004


On Mon, Feb 23, 2004 at 10:59:12AM -0600, Jeremy Brooks wrote:
> 
> I need to quickly come up with a sql statement to run from a perl/DBI
> script that deletes all records from several tables that have a
> particular username, 'joe', in the username column.  I know this is
> probably simple, but what I've done so far hasn't worked as expected.  I
> think that these are the correct DELETE and FROM clauses:
> 
> DELETE t1,t2,t3,t4,t5 FROM t1,t2,t3,t4,t5
> 
> But, I'm not sure how to write the condition that determines what
> records to delete.  let's say I want to delete any record from all of
> the tables that have a username value of 'joe'.
> 
> Can some please show me exactly what the sql statement ought to be?

http://www.mysql.com/documentation/mysql/bychapter/manual_SQL_Syntax.html#DELETE

-- 
<BLINK> ;for (74,1970500640,1634627444,1751478816,1348825708,543711587,
1801810465){for($x=1<<1^1;$x>=1>>1;$x--) {$q=hex ff,$r=oct($x=~s,\d,$&*
10,e,$x),$x/=1/.1,$q<<=$r,$s.=chr (($_&$q)>>$r),$t++}}while($= ||= !$|)
{$o=$o?$?:$/;$|=1;print $o?$s:$"x$t if$;;print"\b"x$t;sleep 1} </BLINK>



More information about the Austin mailing list