You mean SELECT ObjId,ElemId,count( distinct Objid,ElemId ) from Elems group by ObjId;
? 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. > >Thanks, > Csaba Gabor from New York > >__________________________________________________ >Do You Yahoo!? >Yahoo! - Official partner of 2002 FIFA World Cup >http://fifaworldcup.yahoo.com > >--------------------------------------------------------------------- >Before posting, please check: > http://www.mysql.com/manual.php (the manual) > http://lists.mysql.com/ (the list archive) > >To request this thread, e-mail <[EMAIL PROTECTED]> >To unsubscribe, e-mail ><[EMAIL PROTECTED]> >Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php > > --------------------------------------------------------------------- Before posting, please check: http://www.mysql.com/manual.php (the manual) http://lists.mysql.com/ (the list archive) To request this thread, e-mail <[EMAIL PROTECTED]> To unsubscribe, e-mail <[EMAIL PROTECTED]> Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php