1、mysql 自动生成连续日期
java @Param("countArr")String[] countArr sql select date_add(#{startTime},interval @i:=@i+1 day) as date from ( select 1 <foreach item="index" collection="countArr"> union all select 1 </foreach> ) as tmp, (select @i:= -1) t 例如: select date_add('2021-05-01',interval @i:=@i+1 day) as date from ( select 1 union all select 1 ) as tmp, (select @i:= -1) t

2、mysql 自动生成连续数字
select @i:=@i+1 as num
from (
select 1
union all select 1
union all select 1
union all select 1
union all select 1
) as tmp,
(select @i:= 0) t
