Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

ridiculously easy? - counting unique pairs...

Status
Not open for further replies.

christheprogrammer

Programmer
Jul 10, 2000
258
0
0
CA
OK, this shouls be easy. I am terrible with queries as I am a programmer and my mind works in loops much better. Anyway, say I have 2 columns in a table (obviously hypothetical):

monkey blue
chicken red
chicken blue
turtle green
chicken blue
monkey red
monkey blue

Now, I want the output to count up the unique pairs and produce the following:

monkey blue 2
chicken red 1
chicken blue 2
turtle green 1
monkey red 1

Probably a snap for somebody here - I appreciate the replies!

Cheers

Later
 
Chris,

I think I have an answer for you I'm just not sure how to show you here. But let me try:

I put your data in a sample table with these names:

Table Name Goofy (no offense)
Field1
Field2

Then I created a query that looks like this:

field1 field1 field2
goofy goofy goofy
count group by group by
[field1] [field2]

Hope that helps.

Lisa.
 
Thanks to both of you, it was the "group by" that I needed. Cheers & great day

Later
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top