Re: Is there a quick way to do counts on multiple columns

From: Chris <christianboivin1_at_hotmail.com>
Date: 22 Nov 2001 13:15:03 -0800
Message-ID: <da20daf0.0111221315.65d7f129_at_posting.google.com>


Post too quick

correction :

Select sum(decode(COL1,'R',1,0)), 
       sum(decode(COL2,'R',1,0)),
       sum(decode(COL3,'A',1,0)), 
       sum(decode(COL4,'B',1,0))

FROM aTable

Chris

brandonfair_at_hotmail.com (Owen) wrote in message news:<20e5d4a1.0111211545.3a95e60b_at_posting.google.com>...
> if have some code that is something like
> SELECT COUNT(*) FROM aTable for COL1 ="R";
> SELECT COUNT(*) FROM aTable for COL2 ="R";
> SELECT COUNT(*) FROM aTable for COL3 ="A";
> SELECT COUNT(*) FROM aTable for COL4 ="B";
>
> Is there a way to combine these all into one statement?
>
>
> Thanks for any help
>
> Owen
Received on Thu Nov 22 2001 - 22:15:03 CET

Original text of this message