Gerald Taylor <[EMAIL PROTECTED]> wrote on 10/13/2005 12:20:53 PM: > SELECT avg(abs(pmd.value) - (mypmd.value))) as diff, pm.mname, pmd.uid > FROM pmdata pmd, mnames pm, pmdata mypmd > WHERE mypmd.uid= ? > AND pmd.pmid=pm.pmid AND mypmd.pmid=pm.pmid > AND pmd.uid != mypmd.uid GROUP BY pmd.pmid, pmd.uid ORDER BY pmd.uid > > What I would like also to return in this query is a COUNT of the number > of pmd.uid of each different value so I know how many values I got from
> uid#1, uid#2 etc. > > I tried putting COUNT(pmd.uid) as numdelta but it just gave me a 1 in > every row. The problem is I am not doing a straight GROUP BY pmd.uid > Can you explain, in simple language, the question you are trying to answer with this query? I see an "INNER JOIN" and a "!=" used together which makes me wonder if you needed to use one of the OUTER JOINs instead. Along with your explanation, please respond with the results of SHOW CREATE TABLE pmdata\G SHOW CREATE TABLE mnames\G Thanks! Shawn Green Database Administrator Unimin Corporation - Spruce Pine