Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.misc -> Filtering records for a Count

Filtering records for a Count

From: Robert Scheer <rbscheer_at_my-deja.com>
Date: 16 Feb 2006 09:25:13 -0800
Message-ID: <1140110713.818309.263310@g43g2000cwa.googlegroups.com>


Hi.

I have a table with the following fields, among others:

Area          status
43458              4
17866              2
67533              4
67533              5
80236              3
59001              4

I use this simple query to count the areas with the status 4:

SELECT area, COUNT(1) AS Rejected FROM areas WHERE TRUNC(datesent) >= '16/01/2006'
AND TRUNC(datesent) <= '16/01/2006'
AND area <> '00001111'
AND status = 4
AND point <> 'ADG'
GROUP BY area
ORDER BY area

The problem is that, when the same area appears with the status 4 and 5, I can't count this area. In the above table, the area 67533 should not be in my total as it appears twice, with 4 and 5. Is it possible to do that?

Thanks,
Robert Scheer Received on Thu Feb 16 2006 - 11:25:13 CST

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US