```
select * from 
(
select week_of, COUNT(DISTINCT CUSTOMER_ID) AS weekly_developer_count,        COUNT(DISTINCT APPLICATION_ID) as weekly_app_count from
(
select PE.EVENT_DAY_UTC, to_char(next_day(PE.EVENT_DAY_UTC - 1, 'SUNDAY'),   'YYYY-MM-DD') as week_of, PE.CUSTOMER_ID, PE.APPLICATION_ID
  from tablename PE
  where 
  PE.EVENT_DAY_UTC >= SYSDATE - 90
  and PE.EVENT_DAY_UTC < SYSDATE + 1
  and PE.EVENT_NAME NOT LIKE '%.%'
)
group by  week_of
)
order by week_of desc;

```

This is the code I have it in Oracle, MySQL doesn't support NEXT\_DAY. Any idea to achieve this?  

I want as the output something like

```
Weekof ApplicationCount DeveloperCount
2016-17-07  50              10
2016-10-07  60              15

```