我们可以通过以下方式在日期中添加“半年间隔”-
(A)增加6个月的间隔
mysql> Select '2017-06-20' + INTERVAL 6 Month AS 'After Half Year Interval'; +--------------------------+ | After Half Year Interval | +--------------------------+ | 2017-12-20 | +--------------------------+ 1 row in set (0.00 sec)
(B)增加2个季度的间隔
mysql> Select '2017-06-20' + INTERVAL 2 Quarter AS 'After Half Year Interval'; +--------------------------+ | After Half Year Interval | +--------------------------+ | 2017-12-20 | +--------------------------+ 1 row in set (0.00 sec)
上面的查询将在Quarter关键字的帮助下在日期中添加半年间隔。