TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
dip s
NA
256
81.2k
Set Value of a GENERATED column in a table with if condition in MYSQL
Dec 11 2020 1:02 AM
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.
Reply
Answers (
3
)
Store different query results into different Sheets of the same excel
How to Insert only if value is true