Puoi utilizzare una sottoquery
Tabella di esempio
create table visits (day int, userid char(1));
insert visits values
(1,'a'),
(1,'b'),
(2,'b'),
(3,'a'),
(4,'b'),
(4,'c'),
(5,'d');
La domanda
select d.day, (select count(distinct userid) from visits where day<=d.day)
from (select distinct day from visits) d