× The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.



You're half way there already. CTE the current query and query the CTE by max, counting distinct client.

On 09/02/2010 08:32 AM, David FOXWELL wrote:
Hi all,

I have a table like so :

Client Product
C1 P1
C1 P2
C2 P1
C3 P4
C4 P1
C4 P2
C4 P3

With the max, min and avg functions I can see that on average a client has 2 products, that no client has more than 7 products and none with less than 1.

But how can I output :

Number of products Number of clients
1 ?
2
3
4
5
6
7


Thanks.



As an Amazon Associate we earn from qualifying purchases.

This thread ...

Replies:

Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].

Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.