Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.misc -> Re: group by
Ralf Mrowka wrote:
> I have the following table
>
> member1 member2 value
> A B 10
> A C 11
> A L 9
> A F 2
> B K 10
> B O 11
>
> I want to count how often member1 meets member2 given that value is
> larger that XX
> this works fine with
>
> select member1, count(member2) from table where value<XX group by
> member1 ;
>
> The problem is that I also want to see in the result if member1 e.g. A
> meets zero (0) member2 when
> XX is e.g. 40.
>
> Any help is appreciated!
> Thank you!
>
> Ralf
I have no doubt you know what you want. But after reading your posting three times I can only conclude that you have a bit of an issue communicating it to someone else. ;-)
Not having a real clue as to what you actually want ... my suggestion is that you UNION ALL the two queries together.
Daniel Morgan Received on Fri May 31 2002 - 18:21:29 CDT