The parts I am interested in:
(I won't bore you with the fields not relevant to this problem )
CREATE TABLE events (
e_id int(15) NOT NULL auto_increment,
e_owner int(15) NOT NULL default '0',
e_time int(15) NOT NULL default '0',
....other junk omitted....
PRIMARY KEY (e_id)
And I am liking that other answer although it has
all nulls in the second owner column and I don't get how it works.
When I write applications that delete I always
back up the table and use a copy or a small
sample on a play database.
> If you post the table structure (SHOW CREATE TABLE tablename\G) we could
> help you write this statement.
> Shawn Green
> Database Administrator
> Unimin Corporation - Spruce Pine
> Gerald Taylor <platypus@stripped> wrote on 11/10/2004 11:52:35 AM:
> > I have this table of events. Each event has an owner
> > id and the time that it happened.
> > What I want to do is delete all events
> > more than three months old but only if the owner does not own
> > any newer events.
> > The coolest would just be a single DELETE query.
> > Can this be done?
> > Mysql 4.0.18
> > --
> > MySQL General Mailing List
> > For list archives: http://lists.mysql.com/mysql
> > To unsubscribe: http://lists.mysql.com/mysql?unsub=1