Hi!

I've a problem with the UPDATE-Command in MySQL 3.23.36-win:

I want to Update records in a specific order, and the MySQL-Online-Manual
says:
---snip---
7.24 UPDATE Syntax
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.
---snip---

But if i try it, only this happens:
mysql> update test_table set field1=0 order by id;
 ERROR 1064: You have an error in your SQL syntax near 'order by id' at line
1

I've seen an entry in the Changelog for the 4.0.0 saying "Added ORDER BY
syntax to UPDATE and DELETE. ". Is this feature only in version 4.0.0
avaliable ?

p.s. shouldn't it be "SET col_name1=expr1 [, col_name2=expr2, ...]" instead
of "SET col_name1=expr1, [col_name2=expr2, ...]" ?

thanks a lot,

--

Florian Schmidt
mailto:[EMAIL PROTECTED]
http://www.f-24.com


---------------------------------------------------------------------
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

Reply via email to