Re: SQL Count

From: Matt B. <gtimatt_at_home.com>
Date: Tue, 07 Aug 2001 02:32:40 GMT
Message-ID: <crIb7.39850$MC1.11658928_at_news1.elcjn1.sdca.home.com>


"Dennis Hancy" <dennishancy_at_eaton.com> wrote in message news:248587ca.0108060713.1f0037dc_at_posting.google.com...
> I have a SQL script that prints a report containing, among other
> things, a count of the number of employees within an organization.
>
> I need to add to this script, and include a second column containing
> another count. This count is a subset of the first Count column.
>
> In other words, if an organization contains 100 employees, the first
> column for that record would say 100. But I want to print a second
> column with the number of those employees who work in the Finance
> Group. So, my second column might say 10, for example.
>
> Any hints on how to make my SQL do this? Thanks.
>
>
> Dennis

DECODE comes to mind - use the decode function to decode the location, if it's France, return 1, else return 0, and then sum that.

-Matt Received on Tue Aug 07 2001 - 04:32:40 CEST

Original text of this message