Re: Lag function problem was: Never ending activity in temp file
On 4/13/05, Gints Plivna <gints.plivna@(protected):
> The real problem generally was, to count all codes for particular persons=
> but in a following manner:
> if person has code 'LVA' then count it and only it.
> if person hasn't code 'LVA' then count all other codes particular person =
For a question like this you probably don't need analytics at all. You
can write it using simple group by functions:
, nvl( sum( case when code =3D 'LVA' then 1 end ),
count(*) ) code_count
GROUP BY id
Have a nice day.