Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.misc -> Filtering records for a Count
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
![]() |
![]() |