Re: why limit wont work for updats statement Hi,
mysql> CREATE TABLE mytable
-> ( id INTEGER AUTO_INCREMENT PRIMARY KEY,
-> name VARCHAR(100) NOT NULL
-> )type=InnoDB;
Query OK, 0 rows affected, 1 warning (0.21 sec)
mysql> INSERT INTO mytable VALUES (1,'Test');
Query OK, 1 row affected (0.02 sec)
mysql> INSERT INTO mytable VALUES (2,'CanTest');
Query OK, 1 row affected (0.02 sec)
mysql> INSERT INTO mytable VALUES (3,'WillbeTested');
Query OK, 1 row affected (0.02 sec)
mysql> UPDATE mytable SET name = 'Completed' LIMIT 2;
Query OK, 2 rows affected (0.02 sec)
Rows matched: 2 Changed: 2 Warnings: 0
LIMIT works fine with update statement.
Hope this helps.. |