[thelist] one-to-many join problem

Matt Warden mwarden at gmail.com
Sat Jan 14 19:21:54 CST 2006

Hash: SHA1

Brian Cummiskey wrote:
> I think what i want to group on is the confirmation code though...  no?

Sure. I didn't only because it isn't in the selected fields list.

>>your expanded recordset would look like this:
>>joe   guy    1     1    0
>>joe   guy    1     0    0
>>and grouped you will have:
>>joe   guy    2     1    0
>>which I think is what you want.
> let me play a little more with this. 
> My code is very similar to what you have, only i'm joining with an 
> explicit left outer join.

Which is what you want to do if it's possible that there are customers
with no Phones record(s).

> In my table, like you have above, I have a field called dsl, and
> the text value of the plan is stored there if ordered.

That will work just as well. Just use the plan names as the test values
in the case statements.

- --
Matt Warden
Miami University
Oxford, OH, USA

This email proudly and graciously contributes to entropy.
Version: GnuPG v1.4.1 (GNU/Linux)
Comment: Using GnuPG with Thunderbird - http://enigmail.mozdev.org


More information about the thelist mailing list