Link to home
Start Free TrialLog in
Avatar of CalmSoul
CalmSoulFlag for United States of America

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

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 

Open in new window

OUTPUT

Group1 2
Group2 1
Group3 3

Open in new window

Avatar of MikeOM_DBA
MikeOM_DBA
Flag of United States of America image

Yes it's possible, what have you coded?

HINT: Use the COUNT(*) and GROUP BY functions in your query.
Avatar of CalmSoul

ASKER

Added count(*) is giving me following error

Lookup Error
ORA-00936: missing expression
Avatar of David VanZandt
Post your statement please, otherwise we're missing...
ASKER CERTIFIED SOLUTION
Avatar of Geert G
Geert G
Flag of Belgium image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
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