-
New to SQL - Need help writing a COUNT statement
Hi all,
I'm new to SQL and need to write a script that will produce a count of objects for all users. The table is: DBA_objects. I need it grouped by Owner.
Example:
OWNER: OBJECT_NAME:
ABC xxxx
xxxx
xxxx
DEF xxxx
xxxx
And a sub-total at the end.
Any help will be greatly appreciated!
Regards, Keek
Last edited by Keek; 02-10-2004 at 05:43 PM.
-
I dont really get your example. Could you be more specific how your table look like and what is sub-total which is for what?
-
you can do
select owner, count(*)
from dba_objects
group by owner
-
Thanks skhanal!
I sould have been more descriptive, but I am very new to SQl. The actual statement was:
select owner, OBJECT_TYPE, count(*) from dba_objects group by OWNER, OBJECT_TYPE;
Thanks for taking the time to help!
~Keek
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
|