Why not:
delete from a_table where status='flag_value';
Please read the manual, this is one of the most basic operations you
can do, and is obvious the minute you look at
http://www.mysql.com/doc
---------- Original Message ----------------------------------
From: "rob anderson" <[EMAIL PROTECTED]>
Date: Mon, 16 Jul 2001 13:14:20 +0100
>I am trying to delete records from a table, where the 'id' to be
deleted >should only happen if a certain flag (status) exists.
>
>The table contains one or more records for the same id, only the flag
>changes.
>
>I have tried
>
>
>create temporary table temp (id int not null);
>
>select id from tracking where tracking.status = 5;
>
>delete from tracking
> where id = select temp.id from temp;
>
>drop table temp;
>
>
>
>But this fails.
>
>
>
>
>I am not a SQL guru, and would appreciate any help
>
>
>Rob
>
>
--
\\|//
(@ @)
-------oOO---(_)---OOo------------
| |
| Mike Baranski |
| Security Managment Consulting |
| http://www.secmgmt.com |
| |
| |
----------------------------------
|__|__|
|| ||
ooO Ooo
--
---------------------------------------------------------------------
Before posting, please check:
http://www.mysql.com/manual.php (the manual)
http://lists.mysql.com/ (the list archive)
To request this thread, e-mail <[EMAIL PROTECTED]>
To unsubscribe, e-mail <[EMAIL PROTECTED]>
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php