<html>
<head>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=us-ascii">
<meta name=Generator content="Microsoft Word 10 (filtered)">
<style>
<!--
/* Font Definitions */
@font-face
{font-family:Tahoma;
panose-1:2 11 6 4 3 5 4 4 2 4;}
@font-face
{font-family:sans-serif;
panose-1:0 0 0 0 0 0 0 0 0 0;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
{margin:0in;
margin-bottom:.0001pt;
font-size:12.0pt;
font-family:"Times New Roman";}
a:link, span.MsoHyperlink
{color:blue;
text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
{color:purple;
text-decoration:underline;}
p
{margin-right:0in;
margin-left:0in;
font-size:12.0pt;
font-family:"Times New Roman";}
span.EmailStyle18
{font-family:Tahoma;
color:blue;
font-weight:normal;
font-style:normal;
text-decoration:none none;}
@page Section1
{size:8.5in 11.0in;
margin:1.0in 1.25in 1.0in 1.25in;}
div.Section1
{page:Section1;}
-->
</style>
</head>
<body lang=EN-US link=blue vlink=purple>
<div class=Section1>
<p class=MsoNormal><font size=2 color=blue face=Tahoma><span style='font-size:
10.0pt;font-family:Tahoma;color:blue'>Jeffrey –</span></font></p>
<p class=MsoNormal><font size=2 color=blue face=Tahoma><span style='font-size:
10.0pt;font-family:Tahoma;color:blue'>This gives me a count for each name, but
not a total count of unique names.</span></font></p>
<p class=MsoNormal><font size=2 color=blue face=Tahoma><span style='font-size:
10.0pt;font-family:Tahoma;color:blue'> </span></font></p>
<p class=MsoNormal><font size=2 color=blue face=Tahoma><span style='font-size:
10.0pt;font-family:Tahoma;color:blue'>Mark</span></font></p>
<p class=MsoNormal><font size=2 color=blue face=Tahoma><span style='font-size:
10.0pt;font-family:Tahoma;color:blue'> </span></font></p>
<p class=MsoNormal style='margin-left:.5in'><font size=2 face=Tahoma><span
style='font-size:10.0pt;font-family:Tahoma'>-----Original Message-----<br>
<b><span style='font-weight:bold'>From:</span></b> jeffrey.demulling@usbank.com
[mailto:jeffrey.demulling@usbank.com] <br>
<b><span style='font-weight:bold'>Sent:</span></b> Wednesday, May 28, 2003
10:44 AM<br>
<b><span style='font-weight:bold'>To:</span></b> accessd@databaseadvisors.com<br>
<b><span style='font-weight:bold'>Subject:</span></b> Re: [AccessD] Count of
Unique Records</span></font></p>
<p class=MsoNormal style='margin-left:.5in'><font size=3 face="Times New Roman"><span
style='font-size:12.0pt'> </span></font></p>
<p class=MsoNormal style='margin-right:0in;margin-bottom:12.0pt;margin-left:
.5in'><font size=3 face="Times New Roman"><span style='font-size:12.0pt'><br>
</span></font><font size=2 face=sans-serif><span style='font-size:10.0pt;
font-family:sans-serif'>You might try something like this:</span></font> <br>
<br>
<font size=2 face=sans-serif><span style='font-size:10.0pt;font-family:sans-serif'>SELECT
dbo_tblOffices.Name, Count(dbo_tblOffices.Name) AS CountOfName</span></font> <br>
<font size=2 face=sans-serif><span style='font-size:10.0pt;font-family:sans-serif'>FROM
dbo_tblOffices</span></font> <br>
<font size=2 face=sans-serif><span style='font-size:10.0pt;font-family:sans-serif'>GROUP
BY dbo_tblOffices.Name;</span></font> <br>
<br>
<br>
</p>
<table class=MsoNormalTable border=0 cellpadding=0 width="100%"
style='width:100.0%;margin-left:.5in'>
<tr>
<td valign=top style='padding:.75pt .75pt .75pt .75pt'>
<p class=MsoNormal><font size=3 face="Times New Roman"><span
style='font-size:12.0pt'> </span></font></p>
</td>
<td valign=top style='padding:.75pt .75pt .75pt .75pt'>
<p class=MsoNormal><b><font size=1 face=sans-serif><span style='font-size:
7.5pt;font-family:sans-serif;font-weight:bold'>"Mark Boyd"
<MarkBoyd@mcbeeassociates.com></span></font></b> <br>
<font size=1 face=sans-serif><span style='font-size:7.5pt;font-family:sans-serif'>Sent
by: accessd-bounces@databaseadvisors.com</span></font> </p>
<p><font size=1 face=sans-serif><span style='font-size:7.5pt;font-family:
sans-serif'>05/28/2003 09:35 AM</span></font> <br>
<font size=1 face=sans-serif><span style='font-size:7.5pt;font-family:sans-serif'>Please
respond to accessd</span></font> </p>
</td>
<td valign=top style='padding:.75pt .75pt .75pt .75pt'>
<p class=MsoNormal><font size=1 face=Arial><span style='font-size:7.5pt;
font-family:Arial'> </span></font><br>
<font size=1 face=sans-serif><span style='font-size:7.5pt;font-family:sans-serif'>
To: AccessD@databaseadvisors.com</span></font>
<br>
<font size=1 face=sans-serif><span style='font-size:7.5pt;font-family:sans-serif'>
cc: </span></font> <br>
<font size=1 face=sans-serif><span style='font-size:7.5pt;font-family:sans-serif'>
Subject: [AccessD] Count of
Unique Records</span></font></p>
</td>
</tr>
</table>
<p class=MsoNormal style='margin-right:0in;margin-bottom:12.0pt;margin-left:
.5in'><font size=3 face="Times New Roman"><span style='font-size:12.0pt'><br>
<br>
<br>
</span></font><font size=2 face=Tahoma><span style='font-size:10.0pt;
font-family:Tahoma'>I have a table with the following records:</span></font> <br>
<font size=2 face=Tahoma><span style='font-size:10.0pt;font-family:Tahoma'>John</span></font>
<br>
<font size=2 face=Tahoma><span style='font-size:10.0pt;font-family:Tahoma'>John</span></font>
<br>
<font size=2 face=Tahoma><span style='font-size:10.0pt;font-family:Tahoma'>Bill</span></font>
<br>
<font size=2 face=Tahoma><span style='font-size:10.0pt;font-family:Tahoma'>Bob</span></font>
<br>
<font size=2 face=Tahoma><span style='font-size:10.0pt;font-family:Tahoma'> </span></font>
<br>
<font size=2 face=Tahoma><span style='font-size:10.0pt;font-family:Tahoma'>I
need to find out how many unique records there are.</span></font> <br>
<font size=2 face=Tahoma><span style='font-size:10.0pt;font-family:Tahoma'>My
current approach is 1 query grouping the above table.</span></font> <br>
<font size=2 face=Tahoma><span style='font-size:10.0pt;font-family:Tahoma'>Then,
I get a count of grouped records with a 2<sup>nd</sup> query.</span></font> <br>
<font size=2 face=Tahoma><span style='font-size:10.0pt;font-family:Tahoma'> </span></font>
<br>
<font size=2 face=Tahoma><span style='font-size:10.0pt;font-family:Tahoma'>Is
there a way to avoid using 2 queries for this?</span></font> <br>
<font size=2 face=Tahoma><span style='font-size:10.0pt;font-family:Tahoma'>The
above is obviously an example. The table actually holds thousands and
thousands of records.</span></font> <br>
<font size=2 face=Tahoma><span style='font-size:10.0pt;font-family:Tahoma'> </span></font>
<br>
<font size=2 face=Tahoma><span style='font-size:10.0pt;font-family:Tahoma'>Thanks,</span></font>
<br>
<font size=2 face=Tahoma><span style='font-size:10.0pt;font-family:Tahoma'>Mark
Boyd</span></font> <br>
<font size=2 face=Tahoma><span style='font-size:10.0pt;font-family:Tahoma'>Sr.
Systems Analyst</span></font> <br>
<font size=2 face=Tahoma><span style='font-size:10.0pt;font-family:Tahoma'>McBee
Associates, Inc.</span></font> <br>
<font size=2 face="Courier New"><span style='font-size:10.0pt;font-family:
"Courier New"'>_______________________________________________<br>
AccessD mailing list<br>
AccessD@databaseadvisors.com<br>
http://databaseadvisors.com/mailman/listinfo/accessd<br>
Website: http://www.databaseadvisors.com<br>
<br>
</span></font></p>
</div>
</body>
</html>