Yahoo Poland Wyszukiwanie w Internecie

Search results

  1. 1 lut 2010 · Here's a query to update a table based on a comparison of another table. If record is not found in tableB, it will update the "active" value to "n". If it's found, will set the value to NULL. UPDATE tableA LEFT JOIN tableB ON tableA.id = tableB.id SET active = IF(tableB.id IS NULL, 'n', NULL)"; Hope this helps someone else.

  2. 27 sty 2024 · In simple terms, UPSERT is the process of inserting a new record into a MySQL database table if the record does not exist or updating the existing record if it does. This operation is commonly required when you want to ensure that your dataset remains unique while still being able to update records as necessary.

  3. In this article, we would like to show you UPDATE query with IF condition in MySQL. Quick solution: UPDATE `table_name` SET `column_name` = IF(condition , if_true, if_false);

  4. 17 maj 2024 · Updating columns with NULL is handy for various reasons, like fixing missing data or resetting certain values. To pull off this database magic, you'll be using the trusty UPDATE statement with the SET clause.

  5. 29 kwi 2015 · IF EXISTS (select * from users where username = 'something') THEN. update users set id= 'some' where username = 'something'; ELSE. insert into users (username) values ('something'); END IF; end $$. delimiter ; and call it like this: call select_or_insert();

  6. UPDATE Table. The following SQL statement updates the first customer (CustomerID = 1) with a new contact person and a new city.

  7. 23 gru 2009 · MySQL supports the insert-on-duplicate syntax, f.e.: INSERT INTO table (key,col1) VALUES (1,2) ON DUPLICATE KEY UPDATE col1 = 2;

  1. Ludzie szukają również