Anda dapat menggunakan subkueri
Tabel contoh
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');
Kueri
select d.day, (select count(distinct userid) from visits where day<=d.day)
from (select distinct day from visits) d