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.

Sachin SinghRank #66 · 26.2K reputationPosted Dec 10, 2020, 8:19 PM EST
dip sRank #6,374 · 268 reputationPosted Dec 10, 2020, 9:03 PM EST
Sachin SinghRank #66 · 26.2K reputationPosted Dec 10, 2020, 9:10 PM EST