in my my-sql user data, there are two columns, which are u_id and u_name.
I would like to update u_name as u_id if there is no value.
UPDATE T_USER_ACCOUNT SET `u_name`=`u_id` WHERE `u_name` = 'NULL'
I ran this query but it affected 0 row.
what caused the error?
You shouldn’t assign (
=)nullto a column when you want to compare withNULLvalues. The correct way is:in your query,
you are searching for
u_namewhich has a String or VARCHAR value ofNULL