help with query totaling 1st and 2nd result columns
Date: Wed, 9 May 2001 14:56:30 -0700
Message-ID: <9dcedr$e55$1_at_redftp.redftp.attws.com>
Hello,
[Quoted] [Quoted] Sorry for the duplicate postings... not sure which group to post to. I have [Quoted] [Quoted] a fairly simple? enough concept that I'm trying to implement on a query.
[Quoted] Basically we have a users table which has deleted and inactivate users. I'd [Quoted] [Quoted] like my query to show the total (count) of deleted and inactive users. I would also like the query to give me to total of both deleted and inactive on the 3rd column.
So far, here's what I got:
SELECT (SELECT COUNT(1)
FROM kuaf WHERE type = 0 AND name LIKE '%Delete%') "Deleted", (SELECT COUNT(1) FROM kuaf WHERE type = 0 AND name LIKE '%Inactiv%') "Inactivated"FROM dual
My results looks like this:
Deleted Inactivated
---------- -----------
1180 162
Does anyone know how I can add a third column to give me the total of both columns' counts/totals? I realize my SQL may be inefficient, and I could probably make it more inefficient by making a 3rd sub-query that just does a [Quoted] [Quoted] count of both deleted and inactive. But now I'm really more curious rather [Quoted] than anything else.
TIA,
Verna
Received on Wed May 09 2001 - 23:56:30 CEST