SELECT b.author_id,c.author_level,b.days_cnt
from author_tb c,
(
SELECT author_id,count(*)as days_cnt
from(
select distinct author_id,answer_date,DENSE_RANK()over(partition by author_id order by answer_date)
as rn
from answer_tb)a
group by author_id,date_add(answer_date, INTERVAL -rn day)
having days_cnt>=3
order by days_cnt )b
where b.author_id=c.author_id