I have two columns named 'FromTime' and 'ToTime' in a Table.
I have set 'ToTime' column as Generated coulmn.
Now, I want to write an expression for this 'ToTime' column.
What I want to do is,
If 'ToTime ' is not provided while saving data to this table then it should save FromTime's value to 'ToTime' column.
If 'ToTime' is provided while saving data into the table then ToTime's value should be saved to 'ToTime' Column.
How to write this condition/expression for saving data into generated column in MYSQL.
Thank you in advance.