[ale] delete rows in mysql

James Sumners james.sumners at gmail.com
Wed May 5 15:19:19 EDT 2010


I guess I started down the subquery path because you were leading ;)

Let's simplify this some:

DELETE FROM  trigger USING trigger INNER JOIN trigger_group_map WHERE
trigger.trigger_id = trigger_group_map.trigger_id AND
trigger_group_map.trigger_group_id = 3;

That's essentially copied and pasted from
http://dev.mysql.com/doc/refman/5.0/en/delete.html

On Wed, May 5, 2010 at 2:51 PM, Chris Fowler
<cfowler at outpostsentinel.com> wrote:
> On Wed, 2010-05-05 at 13:36 -0400, James Sumners wrote:
>>
>> DELETE FROM trigger a WHERE a.trigger_id IN (SELECT b.trigger_id FROM
>> trigger_group_map b WHERE b.trigger_group_id = 3)
>
> I tried doing something like that months ago.
>
> mysql> DELETE FROM trigger a WHERE a.trigger_id IN (SELECT b.trigger_id
> FROM
>    -> trigger_group_map b WHERE b.trigger_group_id = 3);
>
> ERROR 1064 (42000): You have an error in your SQL syntax; check the
> manual that corresponds to your MySQL server version for the right
> syntax to use near 'WHERE a.trigger_id IN (SELECT b.trigger_id FROM
> trigger_group_map b WHERE b.trig' at line 1


-- 
James Sumners
http://james.roomfullofmirrors.com/

"All governments suffer a recurring problem: Power attracts
pathological personalities. It is not that power corrupts but that it
is magnetic to the corruptible. Such people have a tendency to become
drunk on violence, a condition to which they are quickly addicted."

Missionaria Protectiva, Text QIV (decto)
CH:D 59



More information about the Ale mailing list