Phoenix.pm: mySQL question

Beaves at aol.com Beaves at aol.com
Sun May 21 01:05:40 CDT 2000


I would think this would be a simple solution, as it would seem an often 
occurrence. 

I want to update a particular column, but the where clause contains columns 
from two tables.  I have tried including the other table in the UPDATE 
section after the first one, but I get an error in that case.

Here is what I want to do:  
UPDATE icm_priv, icm_groups SET icm_priv.priv=5 WHERE 
icm_priv.gid=icm_groups.gid
    and
icm_priv.uid=icm_groups.owner;

In english, set the priviledge to 5 for each member where that member is an 
owner of a group.

It would seem to me to be a common occurrence, but mySQL has not accepted any 
syntax that I've thrown at it.  Does mySQL have the capability to update a 
record using a where clause that uses two separate tables?

I know I could do this in two steps using DBI, but that just seems like such 
a waste.



More information about the Phoenix-pm mailing list