CalmSoul
asked on
oracle counts and group by version 8i
I have following query which give list of users and group, I would like to put counts on Users and group by "GroupName"
Please let me know how it is possible
Please let me know how it is possible
select UNIQUE UserName, GroupName from User where UID in
(select GUID from group_user)
User1 Group1
User2 Group1
User3 Group2
User4 Group3
User1 Group3
User1 Group3
User2 Group3
OUTPUT
Group1 2
Group2 1
Group3 3
ASKER
Added count(*) is giving me following error
Lookup Error
ORA-00936: missing expression
Lookup Error
ORA-00936: missing expression
Post your statement please, otherwise we're missing...
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
hmmm, I was thinking the where subquery and the group by couldn't be used together, but live and learn :)
now that you mention that ... hadn't tested it
but indeed ... it works ... also found out after testing
but indeed ... it works ... also found out after testing
HINT: Use the COUNT(*) and GROUP BY functions in your query.