OT] how to update 2 values in each of 3000 records in MySQL

Pete pete at mollysrevenge.com
Wed May 18 12:10:22 EDT 2011


You can update as many records as you want in one instruction as long as you
can identify them in a WHERE statement:

UPDATE tablea SET field1="newvalue" WHERE tablea.fielda="oldvalue"

Pete
Molly's Revenge <http://www.mollysrevenge.com>




On Wed, May 18, 2011 at 8:55 AM, Bob Sneidar <bobs at twft.com> wrote:

> I was under the impression you could only update one record at a time in
> SQL. Sure you can stack queries together and send them all at once (I guess
> that would be quicker). Is there a limit on the size of a SQL statement?
>
> Bob
>
>
> On May 17, 2011, at 11:56 PM, Terry Vogelaar wrote:
>
> > Whether you change record after record, or 50 in one step, depends on the
> values. It is certainly possible to write a massive SQL instruction. But it
> might save your sanity when you change them one by one in a repeat loop,
> with a much simpler SQL query. However, if those 50 records can be filtered
> easily, and if they share values, combining might make sense. Hard to say.
> >
> > Terry
>
>
> _______________________________________________
> use-livecode mailing list
> use-livecode at lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your
> subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode
>
>



More information about the use-livecode mailing list