Search results
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.
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).
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:
18 lut 2018 · You can use below one for one table if you want to update many columns of one table. UPDATE table SET col1 = CASE WHEN col3 = 'name1' THEN 'a' WHEN col3 = '2' THEN b ELSE 0 END , col2 = CASE WHEN col3 = '1' THEN 'b' WHEN col3 = 'name2' THEN 'c' ELSE '' END ;
21 sie 2024 · Data update and data insert are two important functions to add and update data in SQL Server Tables. Using SQL queries we can check for specific data if it exists in a table. The update query with the WHERE Clause can be used to update data passed from the front end or any other data generated from data processing during runtime.
7 gru 2019 · You must see the list of your databases right? Double-click its database name to open a connection to your database; Double-click the table that you want to edit, explore it and happy editing… 😃
2 cze 2016 · I'm trying to create an sql query that pulls two columns from the excel file (JobNo and CustManRef), and updates the field 3rdPartyRef from the job_new table but only where the field DocketNo from the job_dockets is equal to the JobNo column from the excel file.