Re: need help w/ sql query - update and select at once
| From: | Shivanischal A | Date: | Tue, 01 Jul 2003 04:08:15 +0000 |
| Subject: | Re: need help w/ sql query - update and select at once | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-153508@lists.php.net to get a copy of this message | ||
you probably cant ge this to work in PHP. try creating a temporary table
-shiva
<r-militante@northwestern.edu> wrote in message
news:200307010232.h612Wgmq016789@merle.it.northwestern.edu...
> 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
>
>