Query how-to

From: Montaseri <montaseri(at)gmail(dot)com>
To: pgsql-sql(at)postgresql(dot)org
Subject: Query how-to
Date: 2008-10-02 20:49:59
Message-ID: 8078a1730810021349y64187bem8152880a3b90184b@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

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, xxxx, CLOSED. The first status of an item is NEW (could
be used in place of start_date)
For example

Date Opened Closed
=============================
yyyy-mm-dd 25 6
yyyy-mm-dd 0 16
yyyy-mm-dd 12 0
etc
etc

Thanks
Medi

Responses

Browse pgsql-sql by date

  From Date Subject
Next Message Richard Broersma 2008-10-02 21:10:09 Re: Query how-to
Previous Message Tony Wasson 2008-10-01 16:33:16 Re: Can COPY update or skip existing records?