Re: Row count in group

From: Agi <agichen_at_my-deja.com>
Date: Fri, 20 Aug 1999 06:32:55 GMT
Message-ID: <7pisqn$6iq$1_at_nnrp1.deja.com>


In article <01beea6f$cae49500$190114c1_at_sister.grant.UUCP>,   "Alexander I. Doroshko" <aid_at_grant.kharkov.ua> wrote:
> Though rownum is always related to the main query, not a
> subquery, you can get messy result. Quick and dirty
> solution is
>
> select a.dept_id, count(*) rowcnt, a.emp_id from emp a, emp b
> where a.dept_id=b.dept_id and
> b.rowid<=a.rowid
> group by a.dept_id, a.emp_id
> ;

  Thanks Alexander
  It works !!
Rgds,
Agi Chen

Sent via Deja.com http://www.deja.com/
Share what you know. Learn what you don't. Received on Fri Aug 20 1999 - 08:32:55 CEST

Original text of this message