[ale] delete rows in mysql

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


Let's be a little more explicit and see what happens:

DELETE FROM trigger a WHERE a.trigger_id IN (SELECT b.trigger_id FROM
trigger_group_map b WHERE b.trigger_group_id = 3)

And yes, doing this with a query will be much faster than looping
through the tables with perl.

On Wed, May 5, 2010 at 12:10 PM, Chris Fowler
<cfowler at outpostsentinel.com> wrote:
> On Wed, 2010-05-05 at 10:26 -0400, James Sumners wrote:
>> delete from trigger where trigger_id IN ((select trigger_id from
>> trigger_group_map where trigger_group_id=3))
>
> ERROR 1242 (21000): Subquery returns more than 1 row
>
>
> To give a background, about every problem I solve I use perl as the
> tool.  I'm thinking that for something like this SQL would be much
> faster than writing a quickie perl script.
>
> _______________________________________________
> Ale mailing list
> Ale at ale.org
> http://mail.ale.org/mailman/listinfo/ale
> See JOBS, ANNOUNCE and SCHOOLS lists at
> http://mail.ale.org/mailman/listinfo
>



-- 
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