List:General Discussion« Previous MessageNext Message »
From:Gerald Clark Date:June 7 2002 5:43pm
Subject:Re: Counting distinct elements
View as plain text  
You mean

SELECT ObjId,ElemId,count( distinct Objid,ElemId ) from Elems group by 


Csaba Gabor wrote:

>Seems like this should be an easy question, but I just don't get it:
>If I have CREATE TABLE Elems (ObjId INT, ElemId INT);
>Is there a nice query to find the Number of Distinct ElemId's for each ObjId?
>Motivation: Later I will want to add a WHERE ObjId IN (...) and join the Obj
> describing table to
>the results of this query.
>    Csaba Gabor from New York
>Do You Yahoo!?
>Yahoo! - Official partner of 2002 FIFA World Cup
>Before posting, please check:
>   (the manual)
>           (the list archive)
>To request this thread, e-mail <mysql-thread111345@stripped>
>To unsubscribe, e-mail
> <>
>Trouble unsubscribing? Try:

Counting distinct elementsCsaba Gabor7 Jun
  • Re: Counting distinct elementsGerald Clark7 Jun
  • Re: Counting distinct elementsDavid M. Peak7 Jun