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. 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:

  3. 26 lut 2014 · MySQL: Update table using subquery, Excel data. Here’s a snippet of SQL code and a procedure for updating a MySQL database table using a subquery and data from Microsoft Excel (or similar).

  4. 30 lip 2019 · The syntax is as follows to perform UPDATE using IF condition in MySQL update yourTableName set yourColumnName =if(yourColumnName =yourOldValue,yourNewValue,yourColumnName); To understand the above syntax, let us create a table.

  5. 21 sie 2024 · The IF-THEN statement in SQL is used to execute a block of code if a specified condition is true. If the condition evaluates to true, the code within the THEN block is executed. If the condition is false, the block is skipped. Syntax: IF condition THEN. statements; END IF; Parameters Used:

  6. www.mysqltutorial.org › mysql-stored-procedure › mysql-if-statementMySQL IF Statement - MySQL Tutorial

    The IF statement allows you to evaluate one or more conditions and execute the corresponding code block if the condition is true. The IF statement has three forms: IF...THEN statement: Evaluate one condition and execute a code block if the condition is true.

  7. 11 mar 2015 · IF EXISTS (SELECT id FROM user_roles WHERE user_id = 5 AND end_date IS NULL) THEN UPDATE user p JOIN user_roles ur ON p.id = ur.user_id SET ur.end_date = NOW() , p.end_date = NOW() , p.reason = "Retired" WHERE p.id = 5 AND ur.end_date IS NULL ELSE UPDATE user SET end_date = NOW() , reason = "Retired" WHERE id = 5 END IF

  1. Ludzie szukają również