Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.misc -> Re: A SQL question.

Re: A SQL question.

From: Dave Weintraub <d.weintraub_at_jhuapl.edu>
Date: Fri, 18 Sep 1998 11:19:13 -0400
Message-ID: <360279F1.D6BB4D1A@jhuapl.edu>


Select count(*),type,codeno,price from ... group by type,codeno,price;

Zhang Yiquan wrote:

>
> How would I make a query so that I can get the results returned as
> sorted by Type and then CodeNo with a running serial count for each
> Type? For example....
>
> Report Title
>
> Count Type CodeNo Price
> 1 A2 0912 14.00
> 2 A2 0913 16.00
> 3 A2 0914 15.00
> 4 A2 0916 18.00
> 1 A4 1150 25.00
> 2 A4 1152 29.00
> 3 A4 1153 29.00
>
> The thing here is HOW to produce that Count column that would reset at
> every change in Type? I've tried grouping and ordering and even
> rownum, but just cannot get it to reset to 1 at every change in Type.
>
> Thanks in advance!
Received on Fri Sep 18 1998 - 10:19:13 CDT

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US