Trying to find single occurance

G

Guest

I am trying to write a query that will allow me to find precincts that do not
share a location with any other Precinct. I have a table with two columns
Precinct and Sitenum. Each precinct is unique but it can be in a sitenum with
other precincts. I need to find and report parings where precinct and sitenum
are unique..

data looks like this

Precinct Sitenum
7100001 0001
7100002 0001
7100003 0001
7100004 0002
7100005 0003
7100006 0003
7100007 0004
7100007 0004
7100008 0005

I know that I cannot combine the rows because each row is unique but there
are rows where sitenum only occurs one time and that is what I need to
know...
can anyone help me...

Thanks,
--
G. Jay Myatt, Jr.
IT Specialist
Cook County Clerks Office
Chicago, ILL

312-603-1123 Phone
312-603-0982 Fax
 
G

Guest

You need to create a group by query only with the sitenum, with count = to 1

SELECT MyTable.Sitenum
FROM MyTable
GROUP BY MyTable.Sitenum
HAVING Count(MyTable.Sitenum)=1
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads

Make Table Name Parm 14
Export to .dbf 2

Top