LIMIT on INSERT - necessary with unique keys?
Suppose we perform a query like
INSERT INTO my_table (`my_field0`, `my_field1`) VALUES ('my_value0', 'my_value1')
WHERE my_field2 = my_value2 LIMIT 1;
If my_field2 is a UNIQUE field (in my case, an auto-increment field like an id), is the LIMIT statement necessary, or will MySQL know that the first matching row that it finds is the only possible row?
Subject
Views
Written By
Posted
LIMIT on INSERT - necessary with unique keys?
4774
September 10, 2009 06:35AM
2410
September 11, 2009 08:27AM
2375
September 12, 2009 09:50AM
Sorry, you can't reply to this topic. It has been closed.
Content reproduced on this site is the property of the respective copyright holders.
It is not reviewed in advance by Oracle and does not necessarily represent the opinion
of Oracle or any other party.