[AccessD] Count of Unique Records

Mark Boyd MarkBoyd at McBeeAssociates.com
Wed May 28 10:41:02 CDT 2003


Susan -

This is exactly what I'm looking for.

To get a count of '3', I simply removed the last GROUP BY statement.

 

Thanks a lot,

Mark

 

-----Original Message-----
From: Susan Harkins [mailto:harkins at iglou.com] 
Sent: Wednesday, May 28, 2003 11:26 AM
To: accessd at databaseadvisors.com
Subject: Re: [AccessD] Count of Unique Records

 

SELECT groupfield1, Count(groupfield2) 

FROM (SELECT groupfield1, groupfield2

FROM datasource

GROUP BY groupfield1, groupfield2)

GROUP BY groupfield2

 

Maybe that'll get you closer to what you need?

 

Susan H. 


 

	Susan -

	This is pretty much what my 1st query does.

	I then have a 2nd query that counts these records for a total
count of unique records.

	What I want to do is only use 1 query that will return the
number '3'.

	 

	Mark

	 

	-----Original Message-----
	From: Susan Harkins [mailto:harkins at iglou.com] 
	Sent: Wednesday, May 28, 2003 10:59 AM
	To: accessd at databaseadvisors.com
	Subject: Re: [AccessD] Count of Unique Records

	 

	Sure. 

	 

	SELECT Count(field)

	FROM datasource

	GROUP BY field

		----- Original Message ----- 

		From: Mark Boyd <mailto:MarkBoyd at mcbeeassociates.com>  

		To: AccessD at databaseadvisors.com 

		Sent: Wednesday, May 28, 2003 10:35 AM

		Subject: [AccessD] Count of Unique Records

		 

		I have a table with the following records:

		John

		John

		Bill

		Bob

		 

		I need to find out how many unique records there are.

		My current approach is 1 query grouping the above table.

		Then, I get a count of grouped records with a 2nd query.

		 

		Is there a way to avoid using 2 queries for this?

		The above is obviously an example.  The table actually
holds thousands and thousands of records.

		 

		Thanks,

		Mark Boyd

		Sr. Systems Analyst

		McBee Associates, Inc.

		 

		
  _____  


		_______________________________________________
		AccessD mailing list
		AccessD at databaseadvisors.com
		http://databaseadvisors.com/mailman/listinfo/accessd
		Website: http://www.databaseadvisors.com

	
  _____  


	_______________________________________________
	AccessD mailing list
	AccessD at databaseadvisors.com
	http://databaseadvisors.com/mailman/listinfo/accessd
	Website: http://www.databaseadvisors.com

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://databaseadvisors.com/pipermail/accessd/attachments/20030528/57287efb/attachment-0001.html>


More information about the AccessD mailing list