我有这张table:
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
有什么帮助吗?
2条答案
按热度按时间ijnw1ujt1#
xtupzzrd2#
请尝试以下操作: