SQLize Online / PHPize Online  /  SQLtest Online

A A A
Share      Blog   Popular
Copy Format Clear
create table t (day_no int, user_id char); insert into t values (0, 'a'),(0, 'b'),(0, 'c'),(0, 'd'),(0, 'e'),(0, 'f'), (1, 'a'), (2, 'c'),(2, 'e'), (3, 'f'),(3, 'a'), (4, 'a'); select day_no, user_id, count(distinct user_id) over (pertition by day_no order by day_no desc) from t;
Stuck with a problem? Got Error? Ask ChatGPT!
Copy Clear