Yahoo Poland Wyszukiwanie w Internecie

Search results

  1. 9 maj 2013 · Alter my primary/unique key and then substitute them with the modified value: UPDATE table SET unique_key=x* WHERE unique_key=x; UPDATE table SET unique_key=y* WHERE unique_key=y; UPDATE table SET unique_key=y WHERE unique_key=x*; UPDATE table SET unique_key=x WHERE unique_key=y*;

  2. 26 sty 2024 · Using ON DUPLICATE KEY UPDATE. VALUES ('jane.doe@example.com', 'janedoe') ON DUPLICATE KEY UPDATE username = VALUES (username); ‘ON DUPLICATE KEY UPDATE’ allows you to update certain values when a UNIQUE constraint is triggered, ensuring data stays fresh without errors.

  3. MySQL supports an IGNORE keyword for INSERT, UPDATE, and so forth. If you use it, MySQL ignores primary-key or unique-key violations and continues processing with the next row.

  4. 19 mar 2017 · With MySQL, I took advantage of the fact that you can have multiple NULL values in a unique index, so by adding a "tie breaker"(?) field, ucode, I was able to hack together a solution:

  5. MySQL UNIQUE Constraint. The UNIQUE constraint ensures that all values in a column are different. Both the UNIQUE and PRIMARY KEY constraints provide a guarantee for uniqueness for a column or set of columns. A PRIMARY KEY constraint automatically has a UNIQUE constraint.

  6. If you insert or update a value that causes a duplicate in the column1, MySQL rejects the change and issues an error. This UNIQUE constraint is a column constraint. And you can use it to enforce the unique rule for one column.

  7. If you specify an ON DUPLICATE KEY UPDATE clause and a row to be inserted would cause a duplicate value in a UNIQUE index or PRIMARY. KEY, an UPDATE of the old row occurs. For example, if column a is declared as UNIQUE and contains the value 1, the following two statements have similar effect: INSERT INTO t1 (a,b,c) VALUES (1,2,3)

  1. Ludzie szukają również