[thelist] one-to-many join problem

thelist at cjmarsh.com thelist at cjmarsh.com
Sat Jan 14 18:43:21 CST 2006


Brian

[..]

I may have missed the point entirely, but does the following hypothetical
query help at all?

> what i need for the output is:
> 
> Joe codeA 2 1

    SELECT M.Name,
           M.Code
           COUNT(longdistance),
           COUNT(DSL)
      FROM Main M
INNER JOIN Phones P
        ON P.Code = M.Code
     WHERE M.Code = 'A1'
  GROUP BY M.Name,
           M.Code

[..]

Regards

Chris Marsh

-- 
No virus found in this outgoing message.
Checked by AVG Free Edition.
Version: 7.1.371 / Virus Database: 267.14.16/225 - Release Date: 09/01/2006
 




More information about the thelist mailing list