在 Oracle SQL 中,如何在常规列旁边返回 count(*) 列?
什么有效:
select count(*) from TABLE where username = 'USERNAME';
我想做什么:
select username,count(*) from TABLE where username = 'USERNAME';
因此,我希望在计数旁边使用用户名,将其扩展为另一个查询,其中列出了许多用户名及其记录计数。
错误:
ORA-00937: not a single-group group function
00937. 00000 - "not a single-group group function"
*Cause:
*Action:
Error at Line: 7 Column: 7
问题:
那么,我该怎么做呢?