Re: Row count in group
From: Paul Dorsey <pdorsey_at_dulcian.com>
Date: Thu, 19 Aug 1999 10:47:50 GMT
Message-ID: <qhRu3.3176$9K.4023_at_news.rdc1.nj.home.com>
Date: Thu, 19 Aug 1999 10:47:50 GMT
Message-ID: <qhRu3.3176$9K.4023_at_news.rdc1.nj.home.com>
[Quoted] [Quoted] Just add rownum to the select statement. e.g.
[Quoted] select dept_id, rownum, emp_id,name
[Quoted] rownum is a reserved word that will do what you want.
-- Paul Dorsey [Quoted] Dulcian, Inc. www.dulcian.com 212 595 7223 P.S. If you would like to talk to Dulcian about a salaried position on our team, [Quoted] please call me. We have openings in NJ for developers, in CA for PERL developers. [Quoted] Agi wrote in message <7pgis7$hff$1_at_nnrp1.deja.com>...Received on Thu Aug 19 1999 - 12:47:50 CEST
>Hi,everyone,
> I have a problem about row counter.
> If I have a table likes follows
>
> dept_id emp_id name
> ------- ------ -------
> 101 1 Mary
> 101 12 John
> 101 33 Tom
> 102 24 Jim
> 102 25 Peter
> ......
> 109 300 King
>
> Is it possible to get the result via SQL*PLUS ??
>
>
> dept rowcnt emp_id name
> 101 1 1 Mary
> 2 12 John
> 3 33 Tom
>
> 102 1 24 Jim --row# reset on dept
> 2 25 Peter
> ....
>
> I knew it's easy without row# shown,but how to add row counter ??
>
> Is it possible in sqlplus ??
> Any idea ??
>
>Rgds,
>Agi
>
>
>
>Sent via Deja.com http://www.deja.com/
>Share what you know. Learn what you don't.