Попробуйте выполнить запрос из этой демоверсии
SELECT code, name, count(*) absent_days
FROM (
SELECT *,
sum( xx ) over (partition by code order by date ) ss
FROM (
SELECT *,
case when DayStatus = lag(DayStatus) over(partition by code order by Date)
then 0 else 1
end as xx
FROM table1
WHERE DayStatus not in( 'W','H')
) x
) y
WHERE DayStatus = 'A'
GROUP BY code, name, ss
HAVING count(*) >=3
order by code
| code | name | absent_days |
|------|--------|-----------------|
| 101 | John | 3 |
| 105 | Milton | 3 |
| 107 | Saleh | 3 |
| 108 | Virat | 3 |
Эта версия содержит количество дней и дату начала каждого периода
SELECT code, name, count(*) absent_days, min(date) from_date
FROM (
SELECT *,
sum( xx ) over (partition by code order by date ) ss
FROM (
SELECT *,
case when DayStatus = lag(DayStatus) over(partition by code order by Date)
then 0 else 1
end as xx
FROM table1
WHERE DayStatus not in( 'W','H')
) x
) y
WHERE DayStatus = 'A'
GROUP BY code, name, ss
HAVING count(*) >=3
order by code
| code | name | absent_days | from_date |
|------|--------|-------------|----------------------|
| 101 | John | 3 | 2018-05-18T00:00:00Z |
| 105 | Milton | 3 | 2018-05-18T00:00:00Z |
| 107 | Saleh | 3 | 2018-05-17T00:00:00Z |
| 108 | Virat | 3 | 2018-05-17T00:00:00Z |