List:General Discussion« Previous MessageNext Message »
From:Thimble Smith Date:August 10 1999 6:20pm
Subject:Re: DELETE with a twist
View as plain text  
At 18:56, 19990810, Markus Schraudolph wrote:
>Now i´ve found a statement that brings up all those double-entries,
>using an auto-join. It looks like
>
>SELECT t2.kid, t2.tid FROM tip2key t1, tip2key t2
>WHERE t2.tid = t1.tid AND ((t1.kid=9) AND (t2.kid=11))
>
>But now I´ve just got a result set and as I read in the docs
>there is no way in MySQL to use this as an input for a DELETE.

Once sub-selects are implemented, you can
    DELETE FROM tip2key WHERE tid IN (SELECT ...)

In the mean time, you can join all of the IDs you want to delete
into a comma-separated string (using PHP), and then
    DELETE FROM tip2key WHERE tid IN ($list_of_ids)

Tim
Thread
DELETE with a twistMarkus Schraudolph10 Aug
  • Re: DELETE with a twistThimble Smith10 Aug
  • Re: DELETE with a twistMarkus Schraudolph10 Aug