Skip to content

Commit 54e0e89

Browse files
authored
Cumulative stars for a GitHub repository over time
1 parent bb6511c commit 54e0e89

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

sql/cumulative-total-over-time.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,8 @@
22

33
This is a quick trick for creating a cumulative chart of the total number of items created over time based just on their creation date.
44

5-
[Try it here](https://github-to-sqlite.dogsheep.net/github?sql=select%0D%0A++created_at%2C%0D%0A++%28%0D%0A++++select%0D%0A++++++count%28*%29%0D%0A++++from%0D%0A++++++repos+repos2%0D%0A++++where%0D%0A++++++repos2.owner+%3D+%3Ap0%0D%0A++++++and+repos2.created_at+%3C%3D+repos.created_at%0D%0A++%29+as+cumulative%0D%0Afrom%0D%0A++repos%0D%0Awhere%0D%0A++%22owner%22+%3D+%3Ap0%0D%0Aorder+by%0D%0A++created_at+desc&p0=9599#g.mark=line&g.x_column=created_at&g.x_type=temporal&g.y_column=cumulative&g.y_type=quantitative)
5+
- [Example below](https://github-to-sqlite.dogsheep.net/github?sql=select%0D%0A++created_at%2C%0D%0A++%28%0D%0A++++select%0D%0A++++++count%28*%29%0D%0A++++from%0D%0A++++++repos+repos2%0D%0A++++where%0D%0A++++++repos2.owner+%3D+%3Ap0%0D%0A++++++and+repos2.created_at+%3C%3D+repos.created_at%0D%0A++%29+as+cumulative%0D%0Afrom%0D%0A++repos%0D%0Awhere%0D%0A++%22owner%22+%3D+%3Ap0%0D%0Aorder+by%0D%0A++created_at+desc&p0=9599#g.mark=line&g.x_column=created_at&g.x_type=temporal&g.y_column=cumulative&g.y_type=quantitative) which shows number of repositories I have created over time
6+
- [Cumulative stars for a GitHub repository over time](https://github-to-sqlite.dogsheep.net/github?sql=select%0D%0A++starred_at%2C%0D%0A++(%0D%0A++++select%0D%0A++++++count(*)%0D%0A++++from%0D%0A++++++stars+stars2%0D%0A++++where%0D%0A++++++stars2.repo+%3D+stars.repo%0D%0A++++++and+stars2.starred_at+%3C%3D+stars.starred_at%0D%0A++)+as+cumulative%0D%0Afrom%0D%0A++stars%0D%0Awhere%0D%0A++repo+%3D+(select+id+from+repos+where+full_name+%3D+%3Afull_name)%0D%0Aorder+by%0D%0A++starred_at&full_name=dogsheep%2Fgithub-to-sqlite#g.mark=line&g.x_column=starred_at&g.x_type=temporal&g.y_column=cumulative&g.y_type=quantitative)
67

78
```sql
89
select

0 commit comments

Comments
 (0)