Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Mailing Lists -> Oracle-L -> stupid SQL question
--openmail-part-176eea86-00000001
Content-Type: text/plain; charset=US-ASCII
Content-Disposition: inline
;Creation-Date="Wed, 13 Dec 2000 15:37:21 -0600" Content-Transfer-Encoding: 7bit
I'm trying to determine object totals, along with the breakdown of valid/invalid. No problem so far, but I'd like to format the report neatly by getting all three counts on the same line. Is there any way to do this using straight SQL, or should I give up and use PL/SQL instead? I've seen similar things done by giving a table multiple aliases in the query, but can't seem to make it work here. Suggestions and/or pointers would be most appreciated.
Here's an (obviously) broken example, just in case I wasn't clear above...
select count(a.status), count(b.status), count(c.status)
from user_objects a, user_objects b, user_objects c where a.object_type = 'VIEW' and b.object_type = 'VIEW' and c.object_type = 'VIEW' and b.status = 'VALID' and c.status = 'INVALID'
Thanx!
--
My employers like me, but not enough to let me speak for them.
Greg Norris
Sprint LTD Database Administration
Internet: gregory.t.norris_at_mail.sprint.com
--openmail-part-176eea86-00000001--
Received on Wed Dec 13 2000 - 15:37:21 CST
![]() |
![]() |