this was silly from me!
this should naturally look like this:
select case when status ='Closed' then stop_date else start_date end
as adate,
sum(case when status ='Closed' then 1 else 0 end) as
closedCount,
sum(case when status ='New' then 1 else 0 end) as openedCount
fro
Hi,
What about something like that ?
select adate, sum(openedCount) as openedCount, sum(closedCount) as closedCount
from
(
select sum(case when status ='Closed' then stop_date else start_date end) as
adate,
sum(case when status ='Closed' then 1 else 0 end) as closedCount
sum(cas
Montaseri wrote:
Given table T1 and columns id, start_date, stop_date and status, propose
a query that reports count of items opened and closed . status is an
enum including NEW, xxx, , CLOSED. The first status of an item is
NEW (could be used in place of start_date)
For example
Date
On Thu, Oct 2, 2008 at 1:49 PM, Montaseri <[EMAIL PROTECTED]> wrote:
> I was wondering if you can help me with the following query.
>
> Given table T1 and columns id, start_date, stop_date and status, propose a
> query that reports count of items opened and closed . status is an enum
> including NE
Hi,
I was wondering if you can help me with the following query.
Given table T1 and columns id, start_date, stop_date and status, propose a
query that reports count of items opened and closed . status is an enum
including NEW, xxx, , CLOSED. The first status of an item is NEW (could
be used i