On Fri, June 11, 2004 12:50, Jay Macaulay said:
> Hi all,
>
> I have a database where I'm selecting rows using LIMIT.  Is there a way I
> could use LIMIT in an update?  For example right now I do:
>
> SELECT * FROM address WHERE group="a" LIMIT 5;
>
> Is there some way I could instantly update those 5 I retrieved?  Something
> like:
>
> UPDATE address SET retrieved=1 WHERE group="a" LIMIT 5;
>
> So it only updates the same 5 I just selected?  I'm trying to select then
> marked as retrieved.  I don't think I can use LIMIT in an UPDATE statements.

You can only use LIMIT with SELECT statements.  You might try something like:

UPDATE address SET retrieved=1
WHERE ROWID in
(
  SELECT ROWID FROM address WHERE group='a' LIMIT 5
);



---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to