Re: MySql help #1
| From: | elias | Date: | Fri, 03 Aug 2001 07:39:08 +0000 |
| Subject: | Re: MySql help #1 | ||
| References: | 1 2 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-61087@lists.php.net to get a copy of this message | ||
Miles,
The LIMIT works great with UPDATE too.
"Miles Thompson" <milesthompson@ns.sympatico.ca> wrote in message
news:5.0.2.1.0.20010802111104.02605080@pop1.ns.sympatico.ca...
>
> Come on, you're pushing SQL in directions it's not supposed to go! It is
> set oriented after all.
> So it's experimentation time. I've never tried, but as LIMIT works on a
> SELECT, try it on an update. And let us know what happened.
> Miles
>
> At 10:30 AM 8/2/01 +0200, elias wrote:
> >How can I update only N fields from the database?
> >
> >usually we do:
> >
> >UPDATE table1 SET field='VALUE' WHERE condition1
> >
> >now I want to update fields with a certain condition but only X fields
out N
> >total fields.
> >
> >ie:
> >
> >id value
> >--- -------
> >1 a
> >2 b
> >3 c
> >4 d
> >5 e
> >
> >how can i update such like:
> >UPDATE table1 SET {only 2 records} value='aa'
> >so I have any two fields now have the 'aa' value
> >
> >
> >
> >
> >
> >--
> >PHP General Mailing List (http://www.php.net/)
> >To unsubscribe, e-mail: php-general-unsubscribe@lists.php.net
> >For additional commands, e-mail: php-general-help@lists.php.net
> >To contact the list administrators, e-mail: php-list-admin@lists.php.net
>