I stand corrected - sorta.
Look further down in the manual: ORDER BY for UPDATE
is not introduced until v. 4.0.0.
/ Carsten
--
Carsten H. Pedersen
keeper and maintainer of the bitbybit.dk MySQL FAQ
http://www.bitbybit.dk/mysqlfaq
> -----Original Message-----
> From: Denis Gasparin [mailto:[EMAIL PROTECTED]]
> Sent: Wednesday, February 21, 2001 11:05 AM
> To: Carsten H. Pedersen; [EMAIL PROTECTED]
> Subject: RE: UPDATE query with ORDER BY and LIMIT
>
>
>
>
> I see the definition of update in the online manual... This is the link:
> http://www.mysql.com/doc/U/P/UPDATE.html
>
> and this is what is written:
>
> ************ From MySQL manual ONLINE *******************
>
> UPDATE [LOW_PRIORITY] [IGNORE] tbl_name
> SET col_name1=expr1, [col_name2=expr2, ...]
> [WHERE where_definition]
> [ORDER BY ...]
> [LIMIT #]
>
> UPDATE updates columns in existing table rows with new values. The SET
> clause indicates which columns to modify and the values they should be
> given. The WHERE clause, if given, specifies which rows should be
> updated.
> Otherwise all rows are updated. If the ORDER BY clause is specified, the
> rows will be updated in the order that is specified.
>
> ************ End From MySQL manual ONLINE *******************
>
> So i read the manual... but is the manual wrong?
>
> Denis
>
>
>
> At 10.52 21/02/01, Carsten H. Pedersen wrote:
> > > Hi to all!
> > >
> > > I have to use an UPDATE query with ORDER BY and LIMIT clauses.
> > > This is the query:
> > >
> > > UPDATE TBLTEST SET LOCKEDBY='test' WHERE FIELD1 LIKE 'test_' ORDER BY
> > > INS_DATE LIMIT 1;
> > >
> > > MySql tells me that I have an error in my SQL syntax near 'ORDER BY
> > > INS_DATE' at line 1.
> > > I use Mysql 3.23.30-gamma with MyIsam table format.
> > > I have read the manual and the syntax, according to that, seems to be
> > > correct... but... nothing is as it seems.... What is wrong?
> >
> >Then you need to go back to reading the manual again. UPDATE
> >statements do not allow for ORDER BY clauses.
> >
> >/ Carsten
>
>
> ---------------------------------------------------------------------
> Before posting, please check:
> http://www.mysql.com/manual.php (the manual)
> http://lists.mysql.com/ (the list archive)
>
> To request this thread, e-mail <[EMAIL PROTECTED]>
> To unsubscribe, e-mail
> <[EMAIL PROTECTED]>
> Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php
>
---------------------------------------------------------------------
Before posting, please check:
http://www.mysql.com/manual.php (the manual)
http://lists.mysql.com/ (the list archive)
To request this thread, e-mail <[EMAIL PROTECTED]>
To unsubscribe, e-mail <[EMAIL PROTECTED]>
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php