General information
Title:
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
Next
Reply
View the map of this thread
View the map of this thread starting from this message only
View all messages of this thread
View all messages of this thread starting from this message only