0

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.

4

2 に答える 2

0

はい、挿入された行に基づいて値を更新するだけです。

これを行う方法は次のとおりです。

于 2013-10-19T04:45:07.370 に答える