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
質問:
それで、どうすればいいですか?