Yahoo Poland Wyszukiwanie w Internecie

Search results

  1. 23 cze 2013 · I am trying to UPDATE values from a table, but I need to add some conditions. I found the function CASE, but I am not if it is the best method. Here is an example.

  2. 16 kwi 2016 · However, given how the conditions are re-used in your UPDATE statement, you could also take a different approach altogether: represent the affected IDs and the new values as a derived table and use an update with a join:

  3. 29 gru 2017 · You will need to write very complicated conditions if you want to update more than two rows. In such a case you can use INSERT ... ON DUPLICATE KEY UPDATE approach.

  4. 16 lut 2024 · In this article, we’ll learn the use of the CASE statement, IF() function, INSERT ... ON DUPLICATE KEY UPDATE clause and UPDATE with JOIN() function to update multiple columns in multiple rows with different values in MySQL.

  5. 20 gru 2023 · Using case would be an option : UPDATE some_table. SET mark_col_1_as_exported = CASE WHEN exp_col_1 = 1 THEN 0 ELSE mark_col_1_as_exported END , mark_col_2_as_exported = CASE WHEN exp_col_2 = 2 THEN 0 ELSE mark_col_2_as_exported END. WHERE exp_col_1=1 OR exp_col_2=2;

  6. 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); Practical example. To show UPDATE query with IF condition, we will use the following users table:

  7. How we can change two variables in one condition. For example, consider that when @var1<50 , we want to change not only @var1 := @var1+col5 , but also re-assign @var2 := @var2 + 100 . In fact, regardless of the condition 2, we want to increase @var2 , if the first condition fails (the second part).

  1. Ludzie szukają również