Counting distinct elements

2002-06-07 Thread Csaba Gabor
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

Re: Counting distinct elements

2002-06-07 Thread Gerald Clark
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

Re: Counting distinct elements

2002-06-07 Thread David M. Peak
; - Original Message - From: Csaba Gabor [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Friday, June 07, 2002 10:20 AM Subject: Counting distinct elements 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