I want to change all values in the tablecolumn "Quellendatum".
When the row-value is 2005-06-20 then it should be replaced with 2012-06-20. When the row-value is NULL or empty, then it should be untouched.
Currently i modify this manually by selecting the row:
UPDATE `outgoing2`.`tbl_hochschule` SET `Quellendatum` = '2012-06-20' WHERE `tbl_hochschule`.`id` =1;
Is there a way to automate this task?
To set all values in a single column MySQL query, you can use UPDATE command. The syntax is as follows. update yourTableName set yourColumnName =yourValue; To understand the above syntax, let us create a table.
MySQL UPDATE command can be used to update multiple columns by specifying a comma separated list of column_name = new_value. Where column_name is the name of the column to be updated and new_value is the new value with which the column will be updated.
How about:
UPDATE outgoing2.tbl_hochschule SET Quellendatum = '2012-06-20' WHERE Quellendatum = '2005-06-20' AND !isnull( Quellendatum );
In MySql you can do:
UPDATE TABLENAME SET IDCOLUMN=VALUE WHERE IDCOLUMN=VALUE AND !isnull (IDCOLUMN)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With