Path: text.usenetserver.com!out03b.usenetserver.com!news.usenetserver.com!in02.usenetserver.com!news.usenetserver.com!postnews.google.com!j72g2000cwa.googlegroups.com!not-for-mail
From: "hpuxrac" <johnbhurley@sbcglobal.net>
Newsgroups: comp.databases.oracle.server
Subject: Re: Help on query
Date: 12 Dec 2006 15:40:00 -0800
Organization: http://groups.google.com
Lines: 37
Message-ID: <1165966800.184439.276160@j72g2000cwa.googlegroups.com>
References: <1165962006.964669.26780@80g2000cwy.googlegroups.com>
NNTP-Posting-Host: 208.44.49.5
Mime-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
X-Trace: posting.google.com 1165966814 2034 127.0.0.1 (12 Dec 2006 23:40:14 GMT)
X-Complaints-To: groups-abuse@google.com
NNTP-Posting-Date: Tue, 12 Dec 2006 23:40:14 +0000 (UTC)
In-Reply-To: <1165962006.964669.26780@80g2000cwy.googlegroups.com>
User-Agent: G2/1.0
X-HTTP-UserAgent: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.0; .NET CLR 1.1.4322),gzip(gfe),gzip(gfe)
X-HTTP-Via: 1.0 PROXY
Complaints-To: groups-abuse@google.com
Injection-Info: j72g2000cwa.googlegroups.com; posting-host=208.44.49.5;
   posting-account=Dz_3bQ0AAAC5LZNB2NPEJz1sl_a8qcDY
Xref: usenetserver.com comp.databases.oracle.server:419080
X-Received-Date: Tue, 12 Dec 2006 18:40:14 EST (text.usenetserver.com)


vishnu wrote:
> Table Structure will be like this.
> Hi,
>
>  I need to write Oracle query for this.Please help to solve this.
>
> Case ID, Major Type, Requested Date
>
> We need to find the count of cases which are over due, due today,
> between 7-14 days etc as shown in the table.
> Based on comparison between sysdate and requested date.
>
> Can this requirement fit into a query. ?
>
>
> Case Summary
> Major           Over Due        Due Today       Due Next 7-14 Days
> Due Next 15-30 Days     Due Over 30 Days
> Delivery                0       0       4       0       0
> Return          0       0       0       0       0
> Service         0       0       0       0       0
> Relocation              0       0       0       0       0
> Water Intrusion         0       0       0       0       0
>
>
> Thanks,
> Vishnu

You can probably use the oracle aggregation capabilities depending on
what version you are using

select etc rank over ...

You can find the oracle documentation at http://tahiti.oracle.com or do
some searching at Tom Kyte's site for examples http://asktom.oracle.com

