Im new in all of this and Im having a dificult time doing the following: After an Alter Table where Im adding a new column Im updating the values based on another column. What a want to do is where there is a null after the process put the name "LIV".
How would you do it?
Thanks in advance
Code:
ALTER TABLE TEST1 ADD COLUMN UBIC2 STRING;
UPDATE TEST1
SET UBIC2 = UBIC
WHERE ZONA ="X1" or ZONA ="X2"
Tried to use an IFNULL(UBIC2, "LIV")
You could update the table with a
case
expression. Also, since you want to update all the rows of the table, you can lose thewhere
clause: