Můžete použít poddotaz
Ukázková tabulka
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');
Dotaz
select d.day, (select count(distinct userid) from visits where day<=d.day)
from (select distinct day from visits) d