If you wanted to do this using a SELECT you would do a LEFT JOIN or
equivalent action. Glancing over the DELETE syntax in the documentation it
does not look like DELETE supports any such mechanism. I dont think it is
possible to involve more than one table in a DELETE query.
ryan
> I have two tables: table1 and table2.
> Both tables share the same 'account_id'
> column. In table1 there is a column
> 'active' which is always either 'y' (account
> active) or 'n' (account inactive).
>
> Now here is what I want to do...
>
> I want to delete all entries from table2
> with account_id matching account_id in
> table1 and having table1's active='n'.
>
> Is it possible to perform such a delete
> with one query (I know it is with SELECT)?
>
> What's the best approach here?
>
> Thanks for your help!
>
> -- Simon
>
>
> ---------------------------------------------------------------------
> 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
>
---------------------------------------------------------------------
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