【发布时间】:2020-07-27 13:07:57
【问题描述】:
我有这张桌子:
user product log_date
1 aaa 02-02-2020
2 aaa 05-01-2020
1 aaa 03-02-2020
2 aaa 06-01-2020
3 ccc 09-08-2020
我想查询这个
product total_entries total_users
aaa 4 2
ccc 1 1
我这样做了:
SELECT
product,
count(*) total_entries,
count(*) over(partition by product,user ) total_users
from table
group by product;
我收到这个错误
ORA-00979: not a GROUP BY expression
有什么帮助吗?
【问题讨论】: