Answer the question
In order to leave comments, you need to log in
How to write a query that will select the amount for each position?
Either I'm tired already in the evening, I can't figure it out))
There is a table of users, id, registration_date
It is necessary to take the number of users who registered before it for each date.
Answer the question
In order to leave comments, you need to log in
Use window functions
select
distinct(registration_date),
count(*) over (order by registration_date) as registered
from users
order by registration_date;
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question