need help w/ sql query - update and select at once
| From: | r-militante at northwestern dot edu | Date: | Tue, 01 Jul 2003 02:32:34 +0000 |
| Subject: | need help w/ sql query - update and select at once | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-153504@lists.php.net to get a copy of this message | ||
hi i'm trying to get this sql query to work, i'm trying to update and
select at the same time, i'm not even sure if this is even possible
update db.tablename set field1='yes' where (select * from
db.tablename,db.tablename2 where db.tablename.userid=db.tablename2.userid);
basically i have a column called 'userid'. this column exists in both
tablename, and tablename2. where the value of userid in tablename is
equal to the value of userid in tablename2, i'd like to set the value of
field1 to 'yes'.
can this be done from the command line? or am i better off writing
another php page to accomplish this?
thanks again
redmond