I've got a mysql table 'market' with columns open_time (datetime)
, session_num (int)
, duration (int)
, close_time (datetime)
.
How can I make a trigger to automatically calculate the default value for close_time
if someone insert [open_time, session_num, duration]?
I want close_time = open_time + session_num * duration
?
Can trigger do it? Thanks.