List:General Discussion« Previous MessageNext Message »
From:Dan Nelson Date:October 6 1999 5:59pm
Subject:Re: Normalization w/ MySQL?
View as plain text  
In the last episode (Oct 06), James Manning said:
> [ Wednesday, October  6, 1999 ] Dan Nelson wrote:
> > As for deleting orphan records (say you remove a customer record
> > and want all their chopping-cart items removed), you can either
> > remove child records at the time of deletion, or have a nightly
> > cron job that goes through and removes all orphan records en masse.
> 
> So what would this look like? a LEFT JOIN initial query then
> DELETE's? or could it be done with a single delete?

Mysql doesn't have any multi-table delete syntax, so it would have to
be done with a LEFT JOIN into an array, then a DELETE.  You can't do
this from the mysql commandline, though.  You'll need to write a
program/script (C, perl, Pike, PHP, whatever).
 
-- 
	Dan Nelson
	dnelson@stripped
Thread
Normalization w/ MySQL?Steve Freitas6 Oct
Re: Normalization w/ MySQL?Thimble Smith6 Oct
Re: Normalization w/ MySQL?Steve Freitas6 Oct
Re: Normalization w/ MySQL?Dan Nelson6 Oct
  • Re: Normalization w/ MySQL?James Manning6 Oct
    • Re: Normalization w/ MySQL?Dan Nelson6 Oct
Re: Normalization w/ MySQL?Steve Freitas6 Oct
Re: Normalization w/ MySQL?Vivek Khera6 Oct
Re: Normalization w/ MySQL?Bob Kline7 Oct