【发布时间】:2021-05-11 06:10:02
【问题描述】:
在 postgre 中,我想找到 2011 年对以下数据库的“打开”请求数量最多的用户。我是 postgre 的新手,我对此感到困惑。
ID PERSON REQUEST DATE
4 datanoise opened 2008-09-02
5 marsuboss opened 2009-09-02
6 m3talsmith opened 2009-09-06
7 sferik opened 2010-09-08
8 sferik opened 2010-09-09
8 dtrasbo discussed 2010-09-09
8 brianmario discussed 2011-09-09
8 sferik discussed 2011-09-09
9 rsim opened 2011-09-09
.....more tuples to follow
这只是数据库的一小部分,总共大约有 250,000 个元组。
【问题讨论】:
-
到目前为止您尝试过什么吗?可能涉及
wheregroup bysumorder by? -
与your other question 非常相似;如果你想要 2011 年,你应该删除关于提取月份的 SQL,并添加 where 子句: date>='2011-01-01' 和 date
标签: sql database postgresql dataset