Hello Gurelei,
Use subqueries:
select a.group "Group", a.number "Number", a.number/b.cnt*100 "Percent"
from (select group, count(group) number
from test_table
group by group) a,
(select count(*) cnt from test_table) b;
Wednesday, May 01, 2002, 1:57:39 AM, you wrote:
G> Hi all:
G> There have been a few threads here dealing with
G> calculating percentages e.g:
G> Group Number Percent
G> 1 10 10%
G> 2 10 10%
G> 4 70 70%
G> 9 10 10%
G> I'm also sure I saw articles on how to create a report
G> like this via Oracle, but I couldn't find one when I
G> need it. If someone has a query or a link to such an
G> artice, could you please froward it to me.
G> thanks
G> Gene
G> __________________________________________________
G> Do You Yahoo!?
G> Yahoo! Health - your guide to health and wellness
G> http://health.yahoo.com
--
Best regards,
Sergey mailto:[EMAIL PROTECTED]
--
Please see the official ORACLE-L FAQ: http://www.orafaq.com
--
Author: Sergey V Dolgov
INET: [EMAIL PROTECTED]
Fat City Network Services -- (858) 538-5051 FAX: (858) 538-5051
San Diego, California -- Public Internet access / Mailing Lists
--------------------------------------------------------------------
To REMOVE yourself from this mailing list, send an E-Mail message
to: [EMAIL PROTECTED] (note EXACT spelling of 'ListGuru') and in
the message BODY, include a line containing: UNSUB ORACLE-L
(or the name of mailing list you want to be removed from). You may
also send the HELP command for other information (like subscribing).