Information générale
Titre:
Distinct clients in zones
I'm having trouble figuring how to put this problem into SQL. Any help would be appreciated.
I've got a table with clientkey, pzone, dzone. I want to end up with a table that has zone, pnumclients, dnumclients.
"zone" is a combination of all zones in pzone and dzone. "pnumclients" is the number of clients that are listed with that pzone and likewise for dnumclients.
So if I had:
ck pz dz
1 22 23
1 22 23
1 23 22
2 22 23
I'd get:
z pc dc
22 2 1
23 1 2
Any ideas?
Thanks,
-Michelle
Suivant
Répondre
Voir le fil de ce thread
Voir le fil de ce thread à partir de ce message seulement
Voir tous les messages de ce thread
Voir tous les messages de ce thread à partir de ce message seulement