请问有类似这种效果的函数吗?
可以通过sequence函数实现,文档地址 👈
mysql> select sequence(cast('2019-05-15 12:00:00' as datetimev2(0)), cast('2022-05-17 12:00:00' as datetimev2(0)), interval 2 year) as sequence_2_year;
+------------------------------------------------+
| sequence_2_year |
+------------------------------------------------+
| ["2019-05-15 12:00:00", "2021-05-15 12:00:00"] |
+------------------------------------------------+